Solved by MariosOreo in post #2 
              
              
                Hello, 
According to the source we can see that, when shuffle=True the Dataloader initialize a RandomSampler. 
And in RandomSampler, it returns 
return iter(torch.randint(high=n, size=(self.num_samples,), dtype=torch.int64).tolist())

where n and self.num_samples are equal to  len(self.data_source).…