garytho:

is how to implement a version of cross-entropy loss that is numerically stable.


sorry can you detail a little more what you mean by your answer?
Change softmax + log to nn.LogSoftmax and you are golden