class_docstr: Generate Anomaly Heatmap.
  
  Args:
      image_size (ListConfig, tuple): Size of original image used for upscaling the anomaly map.
      sigma (int): Standard deviation of the gaussian kernel used to smooth anomaly map.
      mode (AnomalyMapGenerationMode, optional): Operation used to generate anomaly map.
      Options are `AnomalyMapGenerationMode.ADD` and `AnomalyMapGenerationMode.MULTIPLY`.
      Defaults to "AnomalyMapGenerationMode.MULTIPLY".
  
  Raises:
      ValueError: In case modes other than multiply and add are passed.
code: def __init__(
      self,
      image_size: ListConfig | tuple,
      sigma: int = 4,
      mode: AnomalyMapGenerationMode = AnomalyMapGenerationMode.MULTIPLY,
  ) -> None:
      super().__init__()
      self.image_size = (
          image_size
          if isinstance(image_size, tuple)
          else tuple(image_size)
      )
      self.sigma = sigma
      self.kernel_size = 2 * int(4.0 * sigma + 0.5) + 1
  
      if mode not in (
          AnomalyMapGenerationMode.ADD,
          AnomalyMapGenerationMode.MULTIPLY,
      ):
          raise ValueError(
              f"Found mode {mode}. Only multiply and add are supported."
          )
      self.mode = mode
  
file_path: anomalib/src/anomalib/models/reverse_distillation/anomaly_map.py
imports: from __future__ import annotations
  from enum import Enum
  import torch
  import torch.nn.functional
  from kornia.filters import gaussian_blur2d
  from omegaconf import ListConfig
  from torch import Tensor, nn
label_desc: Use image node_id 1 to create a new AnomalyMapGenerator object from inherited base classes: nn with example: obj = AnomalyMapGenerator(image_size, sigma, mode)