class_docstr: Generate Anomaly Heatmap.
class_docstr_tok: ["Generate","Anomaly","Heatmap","."]
docstr: Return anomaly map.
  
  Raises:
      ``distance`` and ``scale`` keys are not found.
  
  Returns:
      Tensor: Anomaly heatmap.
docstr_tok: ["Return","anomaly","map",".","Raises",":","``","distance","``","and","``","scale","``","keys","are","not","found",".","Returns",":","Tensor",":","Anomaly","heatmap","."]
code: def forward(self, **kwargs) -> Tensor:
      """Return anomaly map.
  
      Raises:
          ``distance`` and ``scale`` keys are not found.
  
      Returns:
          Tensor: Anomaly heatmap.
      """
      if not ("distance" in kwargs and "scale" in kwargs):
          raise ValueError(
              f"Expected keys `distance` and `scale. Found {kwargs.keys()}"
          )
  
      distance: Tensor = kwargs["distance"]
      scale: tuple[int, int] = kwargs["scale"]
  
      score = self.compute_score(distance=distance, scale=scale)
      anomaly_map = self.compute_anomaly_map(score)
  
      return anomaly_map
  
file_path: anomalib/src/anomalib/models/cfa/anomaly_map.py
imports: from __future__ import annotations
  import torch
  import torch.nn.functional
  from einops import rearrange
  from omegaconf import ListConfig
  from torch import Tensor, nn
  from anomalib.models.components import GaussianBlur2d
label_desc: Use image node_id 4 for calling the AnomalyMapGenerator obj's underlying member method code with example usage: obj.forward() and returns: anomaly_map