News for hackers. Stuff that matters.
Re:A common mistake when NumPy’s RNG with PyTorch by nurpax on Sunday April 11, 2021 @04:56PM (#26773344)
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)

There are no comments on this comment yet.