Seed python / numpy / torch for reproducibility (MPS is not bit-exact).
(seed)
| 50 | # --------------------------------------------------------------------------- |
| 51 | |
| 52 | def seed_all(seed): |
| 53 | """Seed python / numpy / torch for reproducibility (MPS is not bit-exact).""" |
| 54 | random.seed(seed) |
| 55 | np.random.seed(seed) |
| 56 | torch.manual_seed(seed) |
| 57 | |
| 58 | |
| 59 | def _atomic_save(state, path): |