Solved by ptrblck in post #2 
              
              
                The DataLoader calls into the passed Dataset's __getitem__ method to load and process the next sample. 
Have a look at these lines of code to see, how the CIFAR10 datasets loads each sample.