Solved by ptrblck in post #5 
              
              
                loss.item() will return a Python scalar value, which is detached from the computation graph. 
If you want to use this loss for training, you should remove this line of code. 
Also, I’m unsure why you need to push the preds and y_batch, to the CPU, but I’m also not familiar with your use case, so you…