If shuffle=True, the DataLoader will use a RandomSampler as seen here 70, which uses torch.randperm in the default setup (replacement=False) and randomly permutes the sample indices. There is thus no uniform sampling but a permutation of the indices.