Hi, ptrblck,
Thanks for your reply. I think I understand:

pred is already passed through log before entering F.kl_div(), that’s why there is no torch.log() for pred.
F.kl_div(pred, target) is KL(target | pred) instead of KL(pred | target), is it correct?