class_docstr: Anomaly Map Generator for CS-Flow model.
  
  Args:
      input_dims (tuple[int, int, int]): Input dimensions.
      mode (AnomalyMapMode): Anomaly map mode. Defaults to AnomalyMapMode.ALL.
docstr: Get anomaly maps by taking mean of the z-distributions across channels.
  
  By default it computes anomaly maps for all the scales as it gave better performance on initial tests.
  Use ``AnomalyMapMode.MAX`` for the largest scale as mentioned in the paper.
  
  Args:
      inputs (Tensor): z-distributions for the three scales.
      mode (AnomalyMapMode): Anomaly map mode.
  
  Returns:
      Tensor: Anomaly maps.
code: def forward(self, inputs: Tensor) -> Tensor:
      """Get anomaly maps by taking mean of the z-distributions across channels.
  
      By default it computes anomaly maps for all the scales as it gave better performance on initial tests.
      Use ``AnomalyMapMode.MAX`` for the largest scale as mentioned in the paper.
  
      Args:
          inputs (Tensor): z-distributions for the three scales.
          mode (AnomalyMapMode): Anomaly map mode.
  
      Returns:
          Tensor: Anomaly maps.
      """
      anomaly_map: Tensor
      if self.mode == AnomalyMapMode.ALL:
          anomaly_map = torch.ones(
              inputs[0].shape[0], 1, *self.input_dims[1:]
          ).to(inputs[0].device)
          for z_dist in inputs:
              mean_z = (z_dist**2).mean(dim=1, keepdim=True)
              anomaly_map *= F.interpolate(
                  mean_z,
                  size=self.input_dims[1:],
                  mode="bilinear",
                  align_corners=False,
              )
      else:
          mean_z = (inputs[0] ** 2).mean(dim=1, keepdim=True)
          anomaly_map = F.interpolate(
              mean_z,
              size=self.input_dims[1:],
              mode="bilinear",
              align_corners=False,
          )
  
      return anomaly_map
  
file_path: anomalib/src/anomalib/models/csflow/anomaly_map.py
imports: from __future__ import annotations
  from enum import Enum
  import torch
  import torch.nn.functional
  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(inputs) and returns: anomaly_map