This commit is contained in:
Glenn Jocher 2020-02-27 22:50:26 -08:00
parent d5815ebfd2
commit b3ecfb10bc
1 changed files with 3 additions and 2 deletions

View File

@ -1,6 +1,7 @@
import os import os
import torch import torch
import torch.backends.cudnn as cudnn
def init_seeds(seed=0): def init_seeds(seed=0):
@ -8,8 +9,8 @@ def init_seeds(seed=0):
# Remove randomness (may be slower on Tesla GPUs) # https://pytorch.org/docs/stable/notes/randomness.html # Remove randomness (may be slower on Tesla GPUs) # https://pytorch.org/docs/stable/notes/randomness.html
if seed == 0: if seed == 0:
torch.backends.cudnn.deterministic = True cudnn.deterministic = True
torch.backends.cudnn.benchmark = False cudnn.benchmark = False
def select_device(device='', apex=False, batch_size=None): def select_device(device='', apex=False, batch_size=None):