Solved by ptrblck in post #4 
              
              
                In your current code snippet images_to_vectors just creates a view of the tensor and I don’t see where real_batch is pushed to the device. Your suggested approach would probably work, but it’s not necessary to rewrap the tensor into a new tensor. Just call real_batch  = real_batch.to('cuda:0') befor…