Code/Pytorch

[Pytorch] Seed 고정

이성훈 Ethan 2023. 5. 9. 03:15
torch.manual_seed(seed)
np.random.seed(seed)
random.seed(seed)

torch.cuda.manual_seed(seed)
torch.cuda.manual_seed_all(seed)
torch.backends.cudnn.deterministic = True
torch.backends.cudnn.benchmark = False