code: def test_replace_context_manager(
      self, name, strict_match, match_device, device
  ):
      self.net.to(device)
      with replace_modules_temp(
          self.net, name, torch.nn.Softmax(), strict_match, match_device
      ):
          self.check_replaced_modules(name, match_device)
      # Check that model was correctly reverted
      self.assertEqual(self.get_num_modules(), self.total)
      self.assertEqual(
          self.get_num_modules(torch.nn.ReLU), self.num_relus
      )
      self.assertEqual(self.get_num_modules(torch.nn.Softmax), 0)
  
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 5 for calling the TestReplaceModule obj's underlying member method code with example usage: obj.test_replace_context_manager(name, strict_match, match_device, device) without return types