class_docstr: Base class for regression metrics.
  Input `y_pred` is compared with ground truth `y`.
  Both `y_pred` and `y` are expected to be real-valued, where `y_pred` is output from a regression model.
  `y_preds` and `y` can be a list of channel-first Tensor (CHW[D]) or a batch-first Tensor (BCHW[D]).
  
  Example of the typical execution steps of this metric class follows :py:class:`monai.metrics.metric.Cumulative`.
  
  Args:
      reduction: define mode of reduction to the metrics, will only apply reduction on `not-nan` values,
          available reduction modes: {``"none"``, ``"mean"``, ``"sum"``, ``"mean_batch"``, ``"sum_batch"``,
          ``"mean_channel"``, ``"sum_channel"``}, default to ``"mean"``. if "none", will not do reduction.
      get_not_nans: whether to return the `not_nans` count, if True, aggregate() returns (metric, not_nans).
          Here `not_nans` count the number of not nans for the metric, thus its shape equals to the shape of the metric.
class_docstr_tok: ["Base","class","for","regression","metrics",".","Input","`","y_pred","`","is","compared","with","ground","truth","`","y","`",".","Both","`","y_pred","`","and","`","y","`","are","expected","to","be","real-valued",",","where","`","y_pred","`","is","output","from","a","regression","model",".","`","y_preds","`","and","`","y","`","can","be","a","list","of","channel-first","Tensor","(","CHW","[","D","]",")","or","a","batch-first","Tensor","(","BCHW","[","D","]",")",".","Example","of","the","typical","execution","steps","of","this","metric","class","follows",":","py",":","class",":","`","monai.metrics.metric.Cumulative","`",".","Args",":","reduction",":","define","mode","of","reduction","to","the","metrics",",","will","only","apply","reduction","on","`","not-nan","`","values",",","available","reduction","modes",":","{","``","``","none","''","``",",","``","``","mean","''","``",",","``","``","sum","''","``",",","``","``","mean_batch","''","``",",","``","``","sum_batch","''","``",",","``","``","mean_channel","''","``",",","``","``","sum_channel","''","``","}",",","default","to","``","``","mean","''","``",".","if","``","none","''",",","will","not","do","reduction",".","get_not_nans",":","whether","to","return","the","`","not_nans","`","count",",","if","True",",","aggregate","(",")","returns","(","metric",",","not_nans",")",".","Here","`","not_nans","`","count","the","number","of","not","nans","for","the","metric",",","thus","its","shape","equals","to","the","shape","of","the","metric","."]
docstr: Args:
      reduction: define mode of reduction to the metrics, will only apply reduction on `not-nan` values,
          available reduction modes: {``"none"``, ``"mean"``, ``"sum"``, ``"mean_batch"``, ``"sum_batch"``,
          ``"mean_channel"``, ``"sum_channel"``}, default to `self.reduction`. if "none", will not do reduction.
docstr_tok: ["Args",":","reduction",":","define","mode","of","reduction","to","the","metrics",",","will","only","apply","reduction","on","`","not-nan","`","values",",","available","reduction","modes",":","{","``","``","none","''","``",",","``","``","mean","''","``",",","``","``","sum","''","``",",","``","``","mean_batch","''","``",",","``","``","sum_batch","''","``",",","``","``","mean_channel","''","``",",","``","``","sum_channel","''","``","}",",","default","to","`","self.reduction","`",".","if","``","none","''",",","will","not","do","reduction","."]
code: def aggregate(
      self, reduction: MetricReduction | str | None = None
  ) -> torch.Tensor | tuple[torch.Tensor, torch.Tensor]:
      """
      Args:
          reduction: define mode of reduction to the metrics, will only apply reduction on `not-nan` values,
              available reduction modes: {``"none"``, ``"mean"``, ``"sum"``, ``"mean_batch"``, ``"sum_batch"``,
              ``"mean_channel"``, ``"sum_channel"``}, default to `self.reduction`. if "none", will not do reduction.
      """
      data = self.get_buffer()
      if not isinstance(data, torch.Tensor):
          raise ValueError(
              "the data to aggregate must be PyTorch Tensor."
          )
  
      f, not_nans = do_metric_reduction(
          data, reduction or self.reduction
      )
      return (f, not_nans) if self.get_not_nans else f
  
imports: from __future__ import annotations
  import math
  from abc import abstractmethod
  from collections.abc import Callable, Sequence
  from functools import partial
  from typing import Any
  import torch
  import torch.nn.functional
  from monai.metrics.utils import do_metric_reduction
  from monai.utils import MetricReduction, StrEnum, convert_data_type, ensure_tuple_rep
  from monai.utils.type_conversion import convert_to_dst_type
  from .metric import CumulativeIterationMetric
label_desc: Use image node_id 2 for calling the RegressionMetric obj's underlying member method code with example usage: obj.aggregate(reduction) and returns: unknown