Solved by KFrank in post #2 
              
              
                Hi Kaustubh! 

These two lines of code are in conflict with one another. 
Your loss_fn, CrossEntropyLoss, expects its outputs argument to 
have shape [nBatch, nClass], and its y argument to have shape 
[nBatch] (no class dimension). 
On the other hand, your torch.argmax(i) == torch.argmax(j) 
test s…