Solved by ptrblck in post #2 
              
              
                You would usually create a custom Dataset and would not change anything in the DataLoader. 
This tutorial shows how to create a custom Dataset and how to apply the transformations in the __getitem__ method.