@Rojin
Actually, I have never used distribution class but based on docs, in this situation you just need to pass them directly to kl_div from distribution if the aforementioned distributions are obtained from Distribution subclasses or you have registered your own.
Please refer to this links for more information:
- https://pytorch.org/docs/stable/distributions.html#torch.distributions.kl.kl_divergence
- https://pytorch.org/docs/stable/distributions.html#torch.distributions.distribution.Distribution
well, you know, my name is Nik, somehow abbreviated of Nikan (a Persian name)
Bests