Skip to content
Snippets Groups Projects
Commit dd848bc1 authored by François  LAURENT's avatar François LAURENT
Browse files

force deterministic cudnn to help the tests

parent 3e8bc2e6
No related branches found
No related tags found
No related merge requests found
...@@ -259,7 +259,8 @@ def enforce_reproducibility(generator=None): ...@@ -259,7 +259,8 @@ def enforce_reproducibility(generator=None):
seed = generator.initial_seed() seed = generator.initial_seed()
# see https://pytorch.org/docs/1.13/notes/randomness.html # see https://pytorch.org/docs/1.13/notes/randomness.html
torch.use_deterministic_algorithms(True) torch.use_deterministic_algorithms(True)
# torch.backends.cudnn.deterministic = True if torch.cuda.is_available:
torch.backends.cudnn.deterministic = True
torch.manual_seed(seed) torch.manual_seed(seed)
seed = seed % 2**32 seed = seed % 2**32
np.random.seed(seed) np.random.seed(seed)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment