class_docstr: Test class for `PeakSignalNoiseRatio` metric.
class_docstr_tok: ["Test","class","for","`","PeakSignalNoiseRatio","`","metric","."]
docstr: Test functional implementation of metric.
docstr_tok: ["Test","functional","implementation","of","metric","."]
code: def test_psnr_functional(
      self, preds, target, ref_metric, data_range, base, reduction, dim
  ):
      """Test functional implementation of metric."""
      _args = {
          "data_range": data_range,
          "base": base,
          "reduction": reduction,
          "dim": dim,
      }
      self.run_functional_metric_test(
          preds,
          target,
          peak_signal_noise_ratio,
          partial(
              ref_metric,
              data_range=data_range,
              reduction=reduction,
              dim=dim,
          ),
          metric_args=_args,
      )
  
imports: from functools import partial
  import numpy
  import pytest
  import torch
  from skimage.metrics import peak_signal_noise_ratio
  from torchmetrics.functional import peak_signal_noise_ratio
  from torchmetrics.image import PeakSignalNoiseRatio
  from torchmetrics.utilities.imports import _TORCH_GREATER_EQUAL_2_1
  from unittests import BATCH_SIZE, NUM_BATCHES, _Input
  from unittests.helpers import seed_all
  from unittests.helpers.testers import MetricTester
label_desc: Use image node_id 2 for calling the TestPSNR obj's underlying member method code with example usage: obj.test_psnr_functional(preds, target, ref_metric, data_range, base, reduction, dim) without return types