code: def _test_auto_model(model, ws, device, sync_bn=False, **kwargs):
      model = auto_model(model, sync_bn=sync_bn, **kwargs)
      bnd = idist.backend()
      if ws > 1 and torch.device(device).type in ("cuda", "cpu"):
          if idist.has_native_dist_support and bnd in ("nccl", "gloo"):
              assert isinstance(
                  model, nn.parallel.DistributedDataParallel
              )
              if sync_bn:
                  assert any(
                      [
                          isinstance(m, nn.SyncBatchNorm)
                          for m in model.modules()
                      ]
                  )
              if "find_unused_parameters" in kwargs:
                  assert (
                      model.find_unused_parameters
                      == kwargs["find_unused_parameters"]
                  )
          elif idist.has_hvd_support and bnd in ("horovod",):
              assert isinstance(model, nn.Module)
      elif (
          device != "cpu"
          and torch.cuda.is_available()
          and torch.cuda.device_count() > 1
      ):
          assert isinstance(model, nn.parallel.DataParallel)
      else:
          assert isinstance(model, nn.Module)
  
      assert all(
          [
              p.device.type == torch.device(device).type
              for p in model.parameters()
          ]
      ), f"{[p.device.type for p in model.parameters()]} vs {torch.device(device).type}"
  
imports: import os
  import pytest
  import torch
  import torch.nn
  import torch.optim
  from torch.utils.data import DataLoader
  from torch.utils.data.dataloader import _InfiniteConstantSampler
  from torch.utils.data.dataset import Dataset, IterableDataset
  from torch.utils.data.distributed import DistributedSampler
  from torch.utils.data.sampler import BatchSampler, RandomSampler, Sampler, SequentialSampler, WeightedRandomSampler
  import ignite.distributed
  from ignite.distributed.auto import auto_dataloader, auto_model, auto_optim, DistributedProxySampler
label_desc: Use image node_id 5 for calling a global function with example usage: _test_auto_model(model, ws, device, sync_bn) without return types