code: def test_distrib_hvd(gloo_hvd_executor):
      device = torch.device(
          "cpu" if not torch.cuda.is_available() else "cuda"
      )
      nproc = (
          4
          if not torch.cuda.is_available()
          else torch.cuda.device_count()
      )
  
      gloo_hvd_executor(
          _test_distrib_compute_on_criterion,
          (device, y_test_1(), y_test_2()),
          np=nproc,
          do_init=True,
      )
      gloo_hvd_executor(
          _test_distrib_accumulator_device,
          (device, y_test_1()),
          np=nproc,
          do_init=True,
      )
  
imports: import os
  from unittest.mock import MagicMock
  import pytest
  import torch
  from numpy.testing import assert_almost_equal
  from torch import nn
  from torch.nn.functional import nll_loss
  import ignite.distributed
  from ignite.engine import State
  from ignite.exceptions import NotComputableError
  from ignite.metrics import Loss, Precision
label_desc: Use image node_id 17 for calling a global function with example usage: test_distrib_hvd(gloo_hvd_executor) without return types