code: def test_multilabel_input_YCbCr(self):
      device = idist.device()
  
      def get_test_cases():
          y_pred = torch.randint(
              16,
              236,
              (n_iters * batch_size, 1, 12, 12),
              dtype=torch.uint8,
              device=device,
          )
          cbcr_pred = torch.randint(
              16,
              241,
              (n_iters * batch_size, 2, 12, 12),
              dtype=torch.uint8,
              device=device,
          )
          y = torch.randint(
              16,
              236,
              (n_iters * batch_size, 1, 12, 12),
              dtype=torch.uint8,
              device=device,
          )
          cbcr = torch.randint(
              16,
              241,
              (n_iters * batch_size, 2, 12, 12),
              dtype=torch.uint8,
              device=device,
          )
  
          y_pred, y = torch.cat((y_pred, cbcr_pred), dim=1), torch.cat(
              (y, cbcr), dim=1
          )
  
          return y_pred, y
  
      n_iters = 100
      batch_size = 10
  
      def out_fn(x):
          return x[0][:, 0, ...], x[1][:, 0, ...]
  
      rank = idist.get_rank()
      for i in range(3):
          # check multiple random inputs as random exact occurencies are rare
          torch.manual_seed(42 + rank + i)
          y_pred, y = get_test_cases()
          _test(
              y_pred,
              y,
              220,
              "cpu",
              n_iters,
              batch_size,
              atol=1e-8,
              output_transform=out_fn,
              compute_y_channel=True,
          )
          if device.type != "xla":
              dev = idist.device()
              _test(
                  y_pred,
                  y,
                  220,
                  dev,
                  n_iters,
                  batch_size,
                  atol=1e-8,
                  output_transform=out_fn,
                  compute_y_channel=True,
              )
  
file_path: ignite/tests/ignite/metrics/test_psnr.py
imports: import numpy
  import pytest
  import torch
  from skimage.metrics import peak_signal_noise_ratio
  import ignite.distributed
  from ignite.engine import Engine
  from ignite.exceptions import NotComputableError
  from ignite.metrics import PSNR
  from ignite.utils import manual_seed
label_desc: Use image node_id 2 for calling the TestDistributed obj's underlying member method code with example usage: obj.test_multilabel_input_YCbCr() and returns: y_pred,  y, x,  x