https://pytorch.org/docs/stable/nn.html#kldivloss
the formula used is
l_n = y_n * (log(y_n) - x_n) 

while it should be
l_n = y_n * (log(y_n) - log(x_n)) 

this could be solved with
loss(log(x), y)

instead of
loss(x, y)

But this is not pretty …
Did you do it on purpose and if you did why?