class_docstr: Generate Anomaly Heatmap.
docstr: Returns anomaly_map.
  
  Expects `distribution`, `height` and 'width' keywords to be passed explicitly
  
  Example
  >>> anomaly_map_generator = AnomalyMapGenerator(image_size=tuple(hparams.model.input_size),
  >>>        pool_layers=pool_layers)
  >>> output = self.anomaly_map_generator(distribution=dist, height=height, width=width)
  
  Raises:
      ValueError: `distribution`, `height` and 'width' keys are not found
  
  Returns:
      torch.Tensor: anomaly map
docstr_tok: ["Returns","anomaly_map",".","Expects","`","distribution","`",",","`","height","`","and","'width","'","keywords","to","be","passed","explicitly","Example",">",">",">","anomaly_map_generator","=","AnomalyMapGenerator","(","image_size=tuple","(","hparams.model.input_size",")",",",">",">",">","pool_layers=pool_layers",")",">",">",">","output","=","self.anomaly_map_generator","(","distribution=dist",",","height=height",",","width=width",")","Raises",":","ValueError",":","`","distribution","`",",","`","height","`","and","'width","'","keys","are","not","found","Returns",":","torch.Tensor",":","anomaly","map"]
code: def forward(
      self, **kwargs: list[Tensor] | list[int] | list[list]
  ) -> Tensor:
      """Returns anomaly_map.
  
      Expects `distribution`, `height` and 'width' keywords to be passed explicitly
  
      Example
      >>> anomaly_map_generator = AnomalyMapGenerator(image_size=tuple(hparams.model.input_size),
      >>>        pool_layers=pool_layers)
      >>> output = self.anomaly_map_generator(distribution=dist, height=height, width=width)
  
      Raises:
          ValueError: `distribution`, `height` and 'width' keys are not found
  
      Returns:
          torch.Tensor: anomaly map
      """
      if not (
          "distribution" in kwargs
          and "height" in kwargs
          and "width" in kwargs
      ):
          raise KeyError(
              f"Expected keys `distribution`, `height` and `width`. Found {kwargs.keys()}"
          )
  
      # placate mypy
      distribution: list[Tensor] = cast(
          List[Tensor], kwargs["distribution"]
      )
      height: list[int] = cast(List[int], kwargs["height"])
      width: list[int] = cast(List[int], kwargs["width"])
      return self.compute_anomaly_map(distribution, height, width)
  
file_path: anomalib/src/anomalib/models/cflow/anomaly_map.py
imports: from __future__ import annotations
  from typing import List, cast
  import torch
  import torch.nn.functional
  from omegaconf import ListConfig
  from torch import Tensor, nn
label_desc: Use image node_id 3 for calling the AnomalyMapGenerator obj's underlying member method code with example usage: obj.forward() and returns: self