class_docstr: Test class for `PeakSignalNoiseRatio` metric.
class_docstr_tok: ["Test","class","for","`","PeakSignalNoiseRatio","`","metric","."]
docstr: Test dtype support of the metric on GPU.
docstr_tok: ["Test","dtype","support","of","the","metric","on","GPU","."]
code: def test_psnr_half_gpu(
      self, preds, target, data_range, reduction, dim, base, ref_metric
  ):
      """Test dtype support of the metric on GPU."""
      self.run_precision_test_gpu(
          preds,
          target,
          PeakSignalNoiseRatio,
          peak_signal_noise_ratio,
          {
              "data_range": data_range,
              "base": base,
              "reduction": reduction,
              "dim": dim,
          },
      )
  
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 4 for calling the TestPSNR obj's underlying member method code with example usage: obj.test_psnr_half_gpu(preds, target, data_range, reduction, dim, base, ref_metric) without return types