code: def test_replace(self, name, strict_match, match_device, device):
      self.net.to(device)
      # replace module(s)
      replaced = replace_modules(
          self.net, name, torch.nn.Softmax(), strict_match, match_device
      )
      self.check_replaced_modules(name, match_device)
      # number of returned modules should equal number of softmax modules
      self.assertEqual(
          len(replaced), self.get_num_modules(torch.nn.Softmax)
      )
      # all replaced modules should be ReLU
      for r in replaced:
          self.assertIsInstance(r[1], torch.nn.ReLU)
      # if a specfic module was named, check that the name matches exactly
      if name == "features.denseblock1.denselayer1.layers.relu1":
          self.assertEqual(replaced[0][0], name)
  
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 4 for calling the TestReplaceModule obj's underlying member method code with example usage: obj.test_replace(name, strict_match, match_device, device) without return types