Solved by ptrblck in post #2 
              
              
                The downside of creating GPU tensors in __getitem__ or push CPU tensors onto the device is that your DataLoader won’t be able to use multiple workers anymore. 
If you try to set num_workers > 0, you’ll get a CUDA error: 

RuntimeError: CUDA error: initialization error 

This also means that your hos…