code: def test_accumulator_device(self, metric_device):
      device = idist.device()
      if metric_device == "process_device":
          metric_device = torch.device(
              device if device.type != "xla" else "cpu"
          )
  
      ssim = SSIM(data_range=1.0, device=metric_device)
  
      assert ssim._kernel is None
      assert isinstance(ssim._kernel_2d, torch.Tensor)
  
      for dev in [ssim._device, ssim._kernel_2d.device]:
          assert (
              dev == metric_device
          ), f"{type(dev)}:{dev} vs {type(metric_device)}:{metric_device}"
  
      y_pred = torch.rand(
          2, 3, 28, 28, dtype=torch.float, device=device
      )
      y = y_pred * 0.65
      ssim.update((y_pred, y))
  
      dev = ssim._sum_of_ssim.device
      assert (
          dev == metric_device
      ), f"{type(dev)}:{dev} vs {type(metric_device)}:{metric_device}"
  
file_path: ignite/tests/ignite/metrics/test_ssim.py
imports: from typing import Sequence, Union
  import numpy
  import pytest
  import torch
  from skimage.metrics import structural_similarity
  import ignite.distributed
  from ignite.exceptions import NotComputableError
  from ignite.metrics import SSIM
label_desc: Use image node_id 2 for calling the TestDistributed obj's underlying member method code with example usage: obj.test_accumulator_device(metric_device) without return types