Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions backends/cadence/aot/tests/test_replace_ops_passes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1250,6 +1250,7 @@ def test_replace_conv1d_with_linear(self) -> None:
inputs,
"ReplaceTrivialConvWithLinear",
rtol=2e-5,
atol=5e-6,
)

# Assert that conv1d is trivially converted to linear
Expand Down Expand Up @@ -1294,6 +1295,7 @@ def test_replace_conv2d_with_linear(self) -> None:
inputs,
"ReplaceTrivialConvWithLinear",
rtol=2e-5,
atol=5e-6,
)

# Assert that conv2d is trivially converted to linear
Expand Down
8 changes: 6 additions & 2 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import hashlib
import sys

import torch
Expand All @@ -13,5 +14,8 @@
"backends/apple/**",
]

# Seed the run
torch.manual_seed(42)

def pytest_runtest_setup(item):
# Set a stable seed for each test based on a hash of the test name.
seed = int(hashlib.sha256(item.nodeid.encode()).hexdigest(), 16) % (2**32)
torch.manual_seed(seed)
Loading