Solved by KFrank in post #2 
              
              
                Hi  Subhankar! 

Pytorch’s CrossEntropyLoss takes as its target (labels) a single 
integer class label for each sample in the batch (i.e., a tensor of shape 
[nBatch]).  That is, target == 2 means that class “2” is the right answer 
with 100% certainty. 
The notion of cross-entropy is more general, …