code: def test_accumulator_device(self):
      device = idist.device()
      metric_devices = [torch.device("cpu")]
      if device.type != "xla":
          metric_devices.append(idist.device())
      for metric_device in metric_devices:
          # Don't test the src=Metric case because compute() returns a scalar,
          # so the metric doesn't accumulate on the device specified
          avg = RunningAverage(
              output_transform=lambda x: x, device=metric_device
          )
          assert avg._device == metric_device
          # Value is None until the first update then compute call
  
          for _ in range(3):
              avg.update(torch.tensor(1.0, device=device))
              avg.compute()
  
              assert (
                  avg._value.device == metric_device
              ), f"{type(avg._value.device)}:{avg._value.device} vs {type(metric_device)}:{metric_device}"
  
imports: import warnings
  from functools import partial
  from itertools import accumulate
  import numpy
  import pytest
  import torch
  import ignite.distributed
  from ignite.engine import Engine, Events
  from ignite.metrics import Accuracy, RunningAverage
  from ignite.metrics.metric import RunningBatchWise, RunningEpochWise, SingleEpochRunningBatchWise
label_desc: Use image node_id 3 for calling the TestDistributed obj's underlying member method code with example usage: obj.test_accumulator_device() without return types