Skip to content

Commit

Permalink
Fix setup_seed function to handle non-list seed
Browse files Browse the repository at this point in the history
  • Loading branch information
njzjz authored Dec 19, 2024
1 parent b95718a commit 124f432
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions deepmd/pt/utils/dataloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
def setup_seed(seed) -> None:
if isinstance(seed, (list, tuple)):
mixed_seed = mix_entropy(seed)
else:
mixed_seed = seed
torch.manual_seed(mixed_seed)
torch.cuda.manual_seed_all(mixed_seed)
torch.backends.cudnn.deterministic = True
Expand Down

0 comments on commit 124f432

Please sign in to comment.