Solved by KFrank in post #2 
              
              
                Hi Kabu! 

No, the documentation for KLDivLoss is correct. 
The equation you posted an image of contains the term: 
y_n (log y_n - x_n)

You are expecting log x_n rather than just x_n.  But KLDivLoss 
expects x_n to be already a log-probability.  Quoting from the 
documentation you linked to: 

As w…