If you are using nn.CrossEntropyLoss, you should remove it completely. It wouldn’t change the result, since F.log_softmax(x, dim=1) == F.log_softmax(F.log_softmax(x, dim=1), dim=1), but it’s unnecessary.