Comment

Comment by nurpax

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)
parent nurpax 5 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton