Skip to content

Commit

Permalink
set cudnn to deterministic when use seed
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiao-Chenguang committed Nov 5, 2024
1 parent 763e415 commit ad30d8f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/tiny_image_net_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ def test_tiny_image_net_cuda(data_path: str = ""):

if args.SEED >= 0:
torch.manual_seed(args.SEED)
torch.backends.cudnn.deterministic = True
torch.backends.cudnn.benchmark = False

assert torch.cuda.is_available(), "CUDA is not available"

Expand Down

0 comments on commit ad30d8f

Please sign in to comment.