nn.CrossEntropyLoss would call into F.cross_entropy in this line of code 4, which would then use nll_loss(log_softmax()) in this line of code 1, so the calls should be equivalent.
Could you post a code snippet to reproduce this issue?