I was trying to minimize the negative log likelihood of a multivariate normal wrt to the mean 1D and covariance matrix
but it gives me an error
m = torch.distributions.normal.Normal(mu, C)  
# mu is Variable of size(n, ) 
# C is Variable  of size (n, n)
loss = -m.log_prob(x) # x is a variable of size (n, )
# above line gives an error

I tried to sample from this distribution but it gives sample with size (n, n) not a (n, ) vector
 m.sample()

I’m stuck here.
I want to get gradients wrt to mu and Cov. Any idea what can I do