Hi，
I test the kl_divergence as follows, the tensors’ shapes are [batch_size,n], where n is my gaussian distribution dimension (i.e. 3 here),
        mu1 = torch.Tensor([[1., 2., 3.],
						[2., 3., 4.]])
        var_1 = torch.Tensor([[1., 1., 1.],
						  [4., 9., 16.]])

	mu2 = torch.Tensor([[1., 3., 4.],
						[2., 3., 4.]])
	var_2 = torch.Tensor([[1., 4., 9.],
						  [4., 9., 16.]])

	p = torch.distributions.Normal(mu1, var_1)
	q = torch.distributions.Normal(mu2, var_2)
	kl_loss = torch.distributions.kl_divergence(p, q)

	print(kl_loss)

The outpur is :
tensor([[0.6542, 0.9488, 1.7096],
        [0.0000, 0.0000, 0.0000]])

Why 3 numbers there for each instance? In my thought, the case above contains two pairs (p,q) , each pair should have a scalar KL loss.
Any ideas? Thank you