As stated in pytorch documentation 13, NLLLoss  is defined as:

I found there is no log  operator in NLLLoss which is different from what I saw in eq.80 in chaper3 of book Neural Networks and Deep Learning 17.
Also I found in documentation 1 it explains torch.nn.CrossEntropyLoss as a combination of LogSoftMax and NLLLoss ,which is also different from the implemention of SoftmaxWithLoss in Caffe as a combination of Softmax and multinomial logistic loss.
I wonder why there is no log operator in torch.nn.NLLLoss and we have to stack a LogSoftMax layer before NLLLoss layer if we want to use NLLLoss ?  Why not put log operator in NLLLoss and take the result of softmax as input?
thanks.