mathematics:

Also found that for using nn.CrossEntropyLoss , we have to explicitly use softmax activation. Is i am right?


No, you should pass the raw logits to nn.CrossEntropyLoss, as internally F.log_softmax and nn.NLLLoss will be used.