(seed=42)
| 78 | |
| 79 | |
| 80 | def seed_everything(seed=42): |
| 81 | os.environ['PYTHONHASHSEED'] = str(seed) |
| 82 | random.seed(seed) |
| 83 | np.random.seed(seed) |
| 84 | torch.manual_seed(seed) |
| 85 | torch.cuda.manual_seed(seed) |
| 86 | torch.cuda.manual_seed_all(seed) |
| 87 | torch.backends.cudnn.deterministic = True |
| 88 | torch.backends.cudnn.benchmark = False |
| 89 | |
| 90 | |
| 91 | class EMA: |
nothing calls this directly
no outgoing calls
no test coverage detected