(args, seed: int)
| 3 | |
| 4 | |
| 5 | def initialize(args, seed: int): |
| 6 | random.seed(seed) |
| 7 | torch.manual_seed(seed) |
| 8 | torch.cuda.manual_seed(seed) |
| 9 | torch.cuda.manual_seed_all(seed) |
| 10 | |
| 11 | torch.backends.cudnn.enabled = True |
| 12 | torch.backends.cudnn.benchmark = True |
| 13 | torch.backends.cudnn.deterministic = False |