code: def test_compute(self, dataloaders):
      device = torch.device(
          f"cuda:{dist.get_rank()}"
          if torch.cuda.is_available()
          else "cpu"
      )
      dataloader = dataloaders[dist.get_rank()]
      # set up engine
      evaluator = SupervisedEvaluator(
          device=device,
          val_data_loader=dataloader,
          epoch_length=len(dataloader),
          network=TestNet(),
          non_blocking=False,
          prepare_batch=PrepareBatchDefault(),
          decollate=False,
      )
      evaluator.run()
      output = evaluator.state.output
      if len(dataloader) > 0:
          assert_allclose(
              output["image"], dataloader[-1]["image"].to(device=device)
          )
          assert_allclose(
              output["label"], dataloader[-1]["label"].to(device=device)
          )
  
file_path: MONAI/tests/test_prepare_batch_default_dist.py
imports: from __future__ import annotations
  import unittest
  import torch
  import torch.distributed
  from parameterized import parameterized
  from monai.engines import PrepareBatchDefault, SupervisedEvaluator
  from tests.utils import DistCall, DistTestCase, assert_allclose
label_desc: Use image node_id 1 for calling the DistributedPrepareBatchDefault obj's underlying member method code with example usage: obj.test_compute(dataloaders) without return types