Skip to content

Instantly share code, notes, and snippets.

@ruslangrimov
Created December 27, 2019 11:02
Show Gist options
  • Save ruslangrimov/9d138a45eff06de17a532fb7cf04ec4a to your computer and use it in GitHub Desktop.
Save ruslangrimov/9d138a45eff06de17a532fb7cf04ec4a to your computer and use it in GitHub Desktop.
Reproducible pytorch cuda
np.random.seed(42)
random.seed(42)
cudnn.benchmark = False
cudnn.deterministic = True
torch.manual_seed(42)
torch.cuda.manual_seed_all(42)
torch.set_printoptions(precision=10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment