code: def _to_sk_peak_signal_noise_ratio_inputs(value, dim):
      value = value.numpy()
      batches = (
          value[None] if value.ndim == len(_input_size) - 1 else value
      )
  
      if dim is None:
          return [batches]
  
      num_dims = np.size(dim)
      if not num_dims:
          return batches
  
      inputs = []
      for batch in batches:
          batch = np.moveaxis(batch, dim, np.arange(-num_dims, 0))
          psnr_input_shape = batch.shape[-num_dims:]
          inputs.extend(batch.reshape(-1, *psnr_input_shape))
      return inputs
  
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 1 for calling a global function with example usage: _to_sk_peak_signal_noise_ratio_inputs(value, dim) and returns: inputs, list, batches