Does __getitem__ of dataloader reset random seed?

This is the small (hopefully easy to follow function):

On each __iter__ the DataLoader returns a new one of these iterators: https://github.com/pytorch/pytorch/blob/master/torch/utils/data/dataloader.py#L302

The iterator creates a new self.workers everytime it’s created: https://github.com/pytorch/pytorch/blob/master/torch/utils/data/dataloader.py#L151-L155

1 Like