I’m trying to use the kl_divergence function with two multivariate normal distributions and I’m getting the following error:
RuntimeError: MAGMA potrf : A(4,4) is 0, A cannot be factorized
The code is this:

import torch
from torch.distributions.multivariate_normal import MultivariateNormal
from torch.distributions import kl_divergence
p = MultivariateNormal(torch.zeros(5).cuda(), torch.eye(5).cuda())
q = MultivariateNormal(torch.randn(1, 5).cuda(), torch.tril(torch.randn(5,5)).cuda())
kl_divergence(p,q)

Do you know why this is happening?
Thank you