Solved by KaiyangZhou in post #2 
              
              
                log_softmax applies logarithm after softmax. 
softmax: 
exp(x_i) / exp(x).sum()

log_softmax: 
log( exp(x_i) / exp(x).sum() )

log_softmax essential does log(softmax(x)), but the practical implementation is different and more efficient while doing the same operation. You might want to have a look at…