Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
[ghstack-poisoned]
  • Loading branch information
vmoens committed Jan 29, 2025
1 parent fd05a77 commit 7d42b8d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/test_collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,9 @@ def _set_seed(self, seed: Optional[int]):
def test_no_synchronize(self, env_device, storing_device, no_cuda_sync):
"""Tests that no_cuda_sync avoids any call to torch.cuda.synchronize() and that the data is not corrupted."""
should_raise = not no_cuda_sync
should_raise = should_raise & ((env_device == "cpu") or (storing_device == "cpu"))
should_raise = should_raise & (
(env_device == "cpu") or (storing_device == "cpu")
)
with patch("torch.cuda.synchronize") as mock_synchronize, pytest.raises(
AssertionError, match="Expected 'synchronize' to not have been called."
) if should_raise else contextlib.nullcontext():
Expand Down

0 comments on commit 7d42b8d

Please sign in to comment.