Calculating loss for entire batch using NLLLoss in 0.4.0

It doesn’t make sense. I need to accumulate gradient.
For example: