import random
import torch

seed = 42
random.seed(seed)
np.random.seed(seed)
torch.manual\_seed(seed)
if torch.cuda.is\_available():
torch.cuda.manual\_seed(seed)
torch.cuda.manual\_seed\_all(seed)
torch.backends.cudnn.benchmark = False
torch.backends.cudnn.deterministic = True