zsyJosh
feat: ✨ SKB explorer
0c3992e
raw
history blame
322 Bytes
import torch
import random
import numpy as np
def set_seed(seed):
"""Sets seed"""
if torch.cuda.is_available():
torch.cuda.manual_seed(seed)
torch.manual_seed(seed)
random.seed(seed)
np.random.seed(seed)
torch.backends.cudnn.benchmark = False
torch.backends.cudnn.deterministic = True