def forward(self, **kwargs) -> torch.Tensor:
        """Generate anomaly map from the provided embeddings and statistics.

        Expects ``embedding``, ``mean`` and ``inv_covariance`` keywords to be
        passed explicitly.

        Example:
            >>> generator = AnomalyMapGenerator(sigma=4)
            >>> anomaly_map = generator(
            ...     embedding=embedding,
            ...     mean=mean,
            ...     inv_covariance=inv_covariance,
            ...     image_size=(224, 224)
            ... )

        Args:
            **kwargs: Keyword arguments containing ``embedding``, ``mean``,
                ``inv_covariance`` and optionally ``image_size``

        Raises:
            ValueError: If required keys are not found in ``kwargs``

        Returns:
            torch.Tensor: Generated anomaly map
        """
        if not ("embedding" in kwargs and "mean" in kwargs and "inv_covariance" in kwargs):
            msg = f"Expected keys `embedding`, `mean` and `covariance`. Found {kwargs.keys()}"
            raise ValueError(msg)

        embedding: torch.Tensor = kwargs["embedding"]
        mean: torch.Tensor = kwargs["mean"]
        inv_covariance: torch.Tensor = kwargs["inv_covariance"]
        image_size: tuple[int, int] | torch.Size = kwargs.get("image_size", None)

        return self.compute_anomaly_map(embedding, mean, inv_covariance, image_size=image_size)
Generate anomaly map from the provided embeddings and statistics.

        Expects ``embedding``, ``mean`` and ``inv_covariance`` keywords to be
        passed explicitly.

        Example:
            >>> generator = AnomalyMapGenerator(sigma=4)
            >>> anomaly_map = generator(
            ...     embedding=embedding,
            ...     mean=mean,
            ...     inv_covariance=inv_covariance,
            ...     image_size=(224, 224)
            ... )

        Args:
            **kwargs: Keyword arguments containing ``embedding``, ``mean``,
                ``inv_covariance`` and optionally ``image_size``

        Raises:
            ValueError: If required keys are not found in ``kwargs``

        Returns:
            torch.Tensor: Generated anomaly map
        
src/anomalib/models/image/padim/anomaly_map.py