Hi John!



 John_Price:

But do you know if there is a function in pytorch which does the same like np.linalg.solve in the above formula?


torch.solve is pytorch’s general linear-equation solver.
Your covariance should be symmetric positive definite, so, if you
cared, you could go the Cholesky- factorization route and use:
torch.cholesky 3
torch.cholesky_solve 1
(You could also pre-compute the covariance's inverse with
torch.inverse or torch.cholesky_inverse.)
But unless you have an unusual use case, I would go with Arul’s
suggestion and use
torch.distributions.multivariate_normal.MultivariateNormal.
Best.
K. Frank