Hacker News new | ask | show | jobs
by nurpax 1889 days ago
This field contains the worker-specific seed:

    torch.utils.data.get_worker_info().seed
So I guess something like the below (untested!) could work too:

   worker_init_fn=lambda id: np.random.seed(torch.utils.data.get_worker_info().seed)