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: Computation logic for `y_pred` and `y` of an iteration, the data should be "batch-first" Tensors.
  A subclass should implement its own computation logic.
  The return value is usually a "batch_first" tensor, or a list of "batch_first" tensors.
docstr_tok: ["Computation","logic","for","`","y_pred","`","and","`","y","`","of","an","iteration",",","the","data","should","be","``","batch-first","''","Tensors",".","A","subclass","should","implement","its","own","computation","logic",".","The","return","value","is","usually","a","``","batch_first","''","tensor",",","or","a","list","of","``","batch_first","''","tensors","."]
code: def _compute_tensor(
      self,
      y_pred: torch.Tensor,
      y: torch.Tensor | None = None,
      **kwargs: Any,
  ) -> TensorOrList:
      """
      Computation logic for `y_pred` and `y` of an iteration, the data should be "batch-first" Tensors.
      A subclass should implement its own computation logic.
      The return value is usually a "batch_first" tensor, or a list of "batch_first" tensors.
      """
      raise NotImplementedError(
          f"Subclass {self.__class__.__name__} must implement this method."
      )
  
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 3 for calling the IterationMetric obj's underlying member method code with example usage: obj._compute_tensor(y_pred, y) without return types