The mutivariate normal distribution is given as

The formula can be calculated using numpy for example the following way:
def multivariate_normal_distribution(x, d, mean, covariance):
  x_m = x - mean
  return (1.0 / (np.sqrt((2 * np.pi)**d * np.linalg.det(covariance))) * np.exp(-(np.linalg.solve(covariance, x_m).T.dot(x_m)) / 2))

I want to do the same calculation but instead of using numpy I want to use pytorch and math. The idea is the following:
def multivariate_normal_distribution(x, d, mean, covariance):
  x_m = x - mean
  return (1.0 / (math.sqrt((2 * math.pi)**d * torch.linalg.det(covariance))) * torch.exp(-(np.linalg.solve(covariance, x_m).T.dot(x_m)) / 2))

The problem is in np.linalg.solve(). I know that with .solve it is possible to solve a linear matrix equation or a system of linear scalar equations. So I want to know if there is a pytorch function that does exactly the same? Help is much appriciated