class_docstr: Generate Anomaly Heatmap.
docstr: Generate Anomaly Heatmap.
  
  This implementation generates the heatmap based on the flow maps
  computed from the normalizing flow (NF) FastFlow blocks. Each block
  yields a flow map, which overall is stacked and averaged to an anomaly
  map.
  
  Args:
      hidden_variables (list[Tensor]): List of hidden variables from each NF FastFlow block.
  
  Returns:
      Tensor: Anomaly Map.
code: def forward(self, hidden_variables: list[Tensor]) -> Tensor:
      """Generate Anomaly Heatmap.
  
      This implementation generates the heatmap based on the flow maps
      computed from the normalizing flow (NF) FastFlow blocks. Each block
      yields a flow map, which overall is stacked and averaged to an anomaly
      map.
  
      Args:
          hidden_variables (list[Tensor]): List of hidden variables from each NF FastFlow block.
  
      Returns:
          Tensor: Anomaly Map.
      """
      flow_maps: list[Tensor] = []
      for hidden_variable in hidden_variables:
          log_prob = (
              -torch.mean(hidden_variable**2, dim=1, keepdim=True)
              * 0.5
          )
          prob = torch.exp(log_prob)
          flow_map = F.interpolate(
              input=-prob,
              size=self.input_size,
              mode="bilinear",
              align_corners=False,
          )
          flow_maps.append(flow_map)
      flow_maps = torch.stack(flow_maps, dim=-1)
      anomaly_map = torch.mean(flow_maps, dim=-1)
  
      return anomaly_map
  
file_path: anomalib/src/anomalib/models/fastflow/anomaly_map.py
imports: from __future__ import annotations
  import torch
  import torch.nn.functional
  from omegaconf import ListConfig
  from torch import Tensor, nn
label_desc: Use image node_id 2 for calling the AnomalyMapGenerator obj's underlying member method code with example usage: obj.forward(hidden_variables) and returns: anomaly_map