code: def test_accumulator_device(self):
      device = idist.device()
      metric_devices = [torch.device("cpu")]
      if torch.device(device).type != "xla":
          metric_devices.append(idist.device())
  
      for metric_device in metric_devices:
          psnr = PSNR(data_range=1.0, device=metric_device)
          dev = psnr._device
          assert dev == metric_device, f"{dev} vs {metric_device}"
  
          y_pred = torch.rand(
              2, 3, 28, 28, dtype=torch.float, device=device
          )
          y = y_pred * 0.65
          psnr.update((y_pred, y))
          dev = psnr._sum_of_batchwise_psnr.device
          assert dev == metric_device, f"{dev} vs {metric_device}"
  
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 5 for calling the TestDistributed obj's underlying member method code with example usage: obj.test_accumulator_device() without return types