szukevin's picture
upload
7900c16
raw
history blame
279 Bytes
import random
import os
import numpy as np
import torch
def set_seed(seed=7):
random.seed(seed)
os.environ['PYTHONHASHSEED'] = str(seed)
np.random.seed(seed)
torch.manual_seed(seed)
torch.cuda.manual_seed(seed)
torch.backends.cudnn.deterministic = True