class_docstr: Multi Variate Gaussian Distribution.
docstr: Calculate multivariate Gaussian distribution.
  
  Args:
    embedding (Tensor): CNN features whose dimensionality is reduced via either random sampling or PCA.
  
  Returns:
    mean and inverse covariance of the multi-variate gaussian distribution that fits the features.
code: def forward(self, embedding: Tensor) -> list[Tensor]:
      """Calculate multivariate Gaussian distribution.
  
      Args:
        embedding (Tensor): CNN features whose dimensionality is reduced via either random sampling or PCA.
  
      Returns:
        mean and inverse covariance of the multi-variate gaussian distribution that fits the features.
      """
      device = embedding.device
  
      batch, channel, height, width = embedding.size()
      embedding_vectors = embedding.view(batch, channel, height * width)
      self.mean = torch.mean(embedding_vectors, dim=0)
      covariance = torch.zeros(
          size=(channel, channel, height * width), device=device
      )
      identity = torch.eye(channel).to(device)
      for i in range(height * width):
          covariance[:, :, i] = (
              self._cov(embedding_vectors[:, :, i], rowvar=False)
              + 0.01 * identity
          )
  
      # calculate inverse covariance as we need only the inverse
      self.inv_covariance = torch.linalg.inv(
          covariance.permute(2, 0, 1)
      )
  
      return [self.mean, self.inv_covariance]
  
file_path: anomalib/src/anomalib/models/components/stats/multi_variate_gaussian.py
imports: from __future__ import annotations
  from typing import Any
  import torch
  from torch import Tensor, nn
label_desc: Use image node_id 3 for calling the MultiVariateGaussian obj's underlying member method code with example usage: obj.forward(embedding) and returns: list