class_docstr: Compute Peak Signal To Noise Ratio between two tensors using function:
  
  .. math::
      \operatorname{PSNR}\left(Y, \hat{Y}\right) = 20 \cdot \log_{10} \left({\mathit{MAX}}_Y\right) \
      -10 \cdot \log_{10}\left(\operatorname{MSE\left(Y, \hat{Y}\right)}\right)
  
  More info: https://en.wikipedia.org/wiki/Peak_signal-to-noise_ratio
  
  Help taken from:
  https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/ops/image_ops_impl.py line 4139
  
  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.
  
  Example of the typical execution steps of this metric class follows :py:class:`monai.metrics.metric.Cumulative`.
  
  Args:
      max_val: The dynamic range of the images/volumes (i.e., the difference between the
          maximum and the minimum allowed values e.g. 255 for a uint8 image).
      reduction: define the mode to reduce metrics, will only execute 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).
class_docstr_tok: ["Compute","Peak","Signal","To","Noise","Ratio","between","two","tensors","using","function",":","..","math",":",":","\\operatorname","{","PSNR","}","\\left","(","Y",",","\\hat","{","Y","}","\\right",")","=","20","\\cdot","\\log_","{","10","}","\\left","(","{","\\mathit","{","MAX","}","}","_Y\\right",")","\\","-10","\\cdot","\\log_","{","10","}","\\left","(","\\operatorname","{","MSE\\left","(","Y",",","\\hat","{","Y","}","\\right",")","}","\\right",")","More","info",":","https",":","\/\/en.wikipedia.org\/wiki\/Peak_signal-to-noise_ratio","Help","taken","from",":","https",":","\/\/github.com\/tensorflow\/tensorflow\/blob\/master\/tensorflow\/python\/ops\/image_ops_impl.py","line","4139","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",".","Example","of","the","typical","execution","steps","of","this","metric","class","follows",":","py",":","class",":","`","monai.metrics.metric.Cumulative","`",".","Args",":","max_val",":","The","dynamic","range","of","the","images\/volumes","(","i.e.",",","the","difference","between","the","maximum","and","the","minimum","allowed","values","e.g",".","255","for","a","uint8","image",")",".","reduction",":","define","the","mode","to","reduce","metrics",",","will","only","execute","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",")","."]
code: def __init__(
      self,
      max_val: int | float,
      reduction: MetricReduction | str = MetricReduction.MEAN,
      get_not_nans: bool = False,
  ) -> None:
      super().__init__(reduction=reduction, get_not_nans=get_not_nans)
      self.max_val = max_val
      self.sq_func = partial(torch.pow, exponent=2.0)
  
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 1 to create a new PSNRMetric object from inherited base classes: RegressionMetric with example: obj = PSNRMetric(max_val, reduction, get_not_nans)