Skip to content

Commit

Permalink
Update seeding: add CUDA seeding
Browse files Browse the repository at this point in the history
  • Loading branch information
zuoxingdong committed Sep 9, 2019
1 parent 6e06813 commit e817053
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lagom/utils/seeding.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ def set_global_seeds(seed):
"""
random.seed(seed)
np.random.seed(seed)
torch.manual_seed(seed) # both torch and torch.cuda internally
torch.manual_seed(seed)
torch.cuda.manual_seed(seed)


class Seeder(object):
Expand Down

0 comments on commit e817053

Please sign in to comment.