Solved by chetan_patil in post #8 
              
              
                You will not get the same value of loss. 
Because,  nn.CrossEntropyLoss() will aggregate the values across all the channels. 
Refer to this doc, https://pytorch.org/docs/master/generated/torch.nn.CrossEntropyLoss.html 
If you scroll down, there will be a formula with 
loss(x,class) = −x[class]+log( …