Skip to content

Commit

Permalink
_check_deterministic
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderDokuchaev committed Mar 1, 2024
1 parent 58d4603 commit 99853c7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/torch/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,12 @@ def _safe_deterministic_state():
torch.use_deterministic_algorithms(torch_deterministic)


@pytest.fixture(autouse=True, scope="function")
def _check_deterministic():
yield
assert not torch.are_deterministic_algorithms_enabled()


# Custom markers specifying tests to be run only if a specific option
# is present on the pytest command line must be registered here.
MARKS_VS_OPTIONS = {**COMMON_SCOPE_MARKS_VS_OPTIONS}
Expand Down

0 comments on commit 99853c7

Please sign in to comment.