code: def _test_distrib_compute(device):
      rank = idist.get_rank()
  
      def _test(metric_device):
          metric_device = torch.device(metric_device)
          m = GeometricMeanAbsoluteError(device=metric_device)
          torch.manual_seed(10 + rank)
  
          y_pred = torch.randint(
              0, 10, size=(10,), device=device
          ).float()
          y = torch.randint(0, 10, size=(10,), device=device).float()
  
          m.update((y_pred, y))
  
          # gather y_pred, y
          y_pred = idist.all_gather(y_pred)
          y = idist.all_gather(y)
  
          np_y_pred = y_pred.cpu().numpy()
          np_y = y.cpu().numpy()
  
          res = m.compute()
  
          sum_errors = (np.log(np.abs(np_y - np_y_pred))).sum()
          np_len = len(y_pred)
          np_ans = np.exp(sum_errors / np_len)
  
          assert np_ans == pytest.approx(res)
  
      for _ in range(3):
          _test("cpu")
          if device.type != "xla":
              _test(idist.device())
  
imports: import os
  import numpy
  import pytest
  import torch
  import ignite.distributed
  from ignite.contrib.metrics.regression import GeometricMeanAbsoluteError
  from ignite.engine import Engine
  from ignite.exceptions import NotComputableError
label_desc: Use image node_id 5 for calling a global function with example usage: _test_distrib_compute(device) without return types