Why use different variations of Softmax in training and validation for neural networks with Pytorch?
It's more of a pytorch implementation thing. log_softmax() outputs the raw logits and they are passed to NLL Loss in training. During inference you just need the probabilities so softmax will suffice.
You don't use different algorithms for training and testing, the question is quite misleading as currently stated. You are using different implementations of the same algorithm.
You can find more on the matter here:

Pytorch discuss
Pytorch discuss #2
Pytorch docs

P.S: I remember encountering the same question on a Udacity scholarship. If you 're reading code from one of their courses, there is probably an explanation on the solution jupyter.