code: def _assert_model(model, true_conf):
      if "cuda" in true_conf["device"]:
          assert model.device() == torch.device(
              f"{true_conf['device']}:{true_conf['local_rank']}"
          )
      else:
          assert model.device() == torch.device(true_conf["device"])
      assert model.get_local_rank() == true_conf["local_rank"]
      assert model.get_rank() == true_conf["rank"]
      assert model.get_world_size() == true_conf["world_size"]
  
      assert model.get_node_rank() == true_conf["node_index"]
      assert model.get_nnodes() == true_conf["nnodes"]
      assert model.get_nproc_per_node() == true_conf["nproc_per_node"]
  
file_path: ignite/tests/ignite/distributed/comp_models/test_horovod.py
imports: import pytest
  import torch
  from ignite.distributed.comp_models import has_hvd_support
label_desc: Use image node_id 2 for calling a global function with example usage: _assert_model(model, true_conf) without return types