code: def check_replaced_modules(self, name, match_device):
      # total num modules should remain the same
      self.assertEqual(self.total, self.get_num_modules())
      num_relus_mod = self.get_num_modules(torch.nn.ReLU)
      num_softmax = self.get_num_modules(torch.nn.Softmax)
      # list of returned modules should be as long as number of softmax
      self.assertEqual(self.num_relus, num_relus_mod + num_softmax)
      if name == "relu":
          # at least 2 softmaxes
          self.assertGreaterEqual(num_softmax, 2)
      else:
          # one softmax
          self.assertEqual(num_softmax, 1)
      if match_device:
          self.assertEqual(
              len(list({i.device for i in self.net.parameters()})), 1
          )
  
file_path: MONAI/tests/test_replace_module.py
imports: from __future__ import annotations
  import unittest
  import torch
  from parameterized import parameterized
  from monai.networks.nets import DenseNet121
  from monai.networks.utils import replace_modules, replace_modules_temp
  from tests.utils import TEST_DEVICES
label_desc: Use image node_id 3 for calling the TestReplaceModule obj's underlying member method code with example usage: obj.check_replaced_modules(name, match_device) without return types