Solved by ptrblck in post #2 
              
              
                load_dataset would be a function, which returns the DataLoader not a class. 
I would claim it depends on your coding style and wrapping the DataLoader creation into a function might allow you to move it into another file more easily. 

This class definition would be used to create a custom Dataset …