Solved by ptrblck in post #2 
              
              
                Both approaches would most likely work, although I think you could remove the DataLoader from the first approach and add shuffling manually, if wanted. 
If you have already loaded the data into the RAM, you could directly get the samples via indexing or gather.