Solved by tom in post #2 
              
              
                So if we look at the documentation for kl_div we are instructed to See KLDivLoss for details. 
There it says: 

the input given is expected to contain log-probabilities and is not restricted to a 2D Tensor. The targets are interpreted as probabilities by default, but could be considered as log-proba…