class_docstr: Base class for metrics computation at the iteration level, that is, on a min-batch of samples
  usually using the model outcome of one iteration.
  
  `__call__` is designed to handle `y_pred` and `y` (optional) in torch tensors or a list/tuple of tensors.
  
  Subclasses typically implement the `_compute_tensor` function for the actual tensor computation logic.
class_docstr_tok: ["Base","class","for","metrics","computation","at","the","iteration","level",",","that","is",",","on","a","min-batch","of","samples","usually","using","the","model","outcome","of","one","iteration",".","`","__call__","`","is","designed","to","handle","`","y_pred","`","and","`","y","`","(","optional",")","in","torch","tensors","or","a","list\/tuple","of","tensors",".","Subclasses","typically","implement","the","`","_compute_tensor","`","function","for","the","actual","tensor","computation","logic","."]
docstr: Execute basic computation for model prediction `y_pred` and ground truth `y` (optional).
  It supports inputs of a list of "channel-first" Tensor and a "batch-first" Tensor.
  
  Args:
      y_pred: the raw model prediction data at one iteration, must be a list of `channel-first` Tensor
          or a `batch-first` Tensor.
      y: the ground truth to compute, must be a list of `channel-first` Tensor
          or a `batch-first` Tensor.
      kwargs: additional parameters for specific metric computation logic (e.g. ``spacing`` for SurfaceDistanceMetric, etc.).
  
  Returns:
      The computed metric values at the iteration level.
      The output shape could be a `batch-first` tensor or a list of `batch-first` tensors.
      When it's a list of tensors, each item in the list can represent a specific type of metric.
docstr_tok: ["Execute","basic","computation","for","model","prediction","`","y_pred","`","and","ground","truth","`","y","`","(","optional",")",".","It","supports","inputs","of","a","list","of","``","channel-first","''","Tensor","and","a","``","batch-first","''","Tensor",".","Args",":","y_pred",":","the","raw","model","prediction","data","at","one","iteration",",","must","be","a","list","of","`","channel-first","`","Tensor","or","a","`","batch-first","`","Tensor",".","y",":","the","ground","truth","to","compute",",","must","be","a","list","of","`","channel-first","`","Tensor","or","a","`","batch-first","`","Tensor",".","kwargs",":","additional","parameters","for","specific","metric","computation","logic","(","e.g",".","``","spacing","``","for","SurfaceDistanceMetric",",","etc.",")",".","Returns",":","The","computed","metric","values","at","the","iteration","level",".","The","output","shape","could","be","a","`","batch-first","`","tensor","or","a","list","of","`","batch-first","`","tensors",".","When","it","'s","a","list","of","tensors",",","each","item","in","the","list","can","represent","a","specific","type","of","metric","."]
code: def __call__(
      self,
      y_pred: TensorOrList,
      y: TensorOrList | None = None,
      **kwargs: Any,
  ) -> torch.Tensor | Sequence[torch.Tensor | Sequence[torch.Tensor]]:
      """
      Execute basic computation for model prediction `y_pred` and ground truth `y` (optional).
      It supports inputs of a list of "channel-first" Tensor and a "batch-first" Tensor.
  
      Args:
          y_pred: the raw model prediction data at one iteration, must be a list of `channel-first` Tensor
              or a `batch-first` Tensor.
          y: the ground truth to compute, must be a list of `channel-first` Tensor
              or a `batch-first` Tensor.
          kwargs: additional parameters for specific metric computation logic (e.g. ``spacing`` for SurfaceDistanceMetric, etc.).
  
      Returns:
          The computed metric values at the iteration level.
          The output shape could be a `batch-first` tensor or a list of `batch-first` tensors.
          When it's a list of tensors, each item in the list can represent a specific type of metric.
  
      """
      # handling a list of channel-first data
      if isinstance(y_pred, (list, tuple)) or isinstance(
          y, (list, tuple)
      ):
          return self._compute_list(y_pred, y, **kwargs)
      # handling a single batch-first data
      if isinstance(y_pred, torch.Tensor):
          y_ = y.detach() if isinstance(y, torch.Tensor) else None
          return self._compute_tensor(y_pred.detach(), y_, **kwargs)
      raise ValueError(
          "y_pred or y must be a list/tuple of `channel-first` Tensors or a `batch-first` Tensor."
      )
  
imports: from __future__ import annotations
  from abc import ABC, abstractmethod
  from collections.abc import Sequence
  from typing import Any
  import torch
  from monai.config import TensorOrList
  from monai.utils import convert_data_type, evenly_divisible_all_gather
label_desc: Use image node_id 1 for calling the IterationMetric obj's underlying member method code with example usage: obj.__call__(y_pred, y) and returns: self, self