Hi,
As i guess, KL divergence is supposed to return a numerical value representing the  distance between 2 probability distributions in feature space. However, this is what I got using log softmax…
>>> k=torch.rand(256)
>>> k1=k.clone()
>>> F.kl_div(F.log_softmax(k),k1,reduction="none").mean()
tensor(2.4483)

On the other hand when I use simple log, the answer is zero, which is expected. Can you let me know what i should use when comparing 2 layers in pytorch with KL divergence?