code: def test_patch_module_replaces_all_dropout_layers(inplace):
      test_module = SimpleModel()
  
      mc_test_module = patch_module(
          test_module,
          inplace=inplace,
          layers=["Conv2d", "Linear", "LSTM", "GRU"],
      )
  
      # objects should be the same if inplace is True and not otherwise:
      assert (mc_test_module is test_module) == inplace
      assert not any(
          module.p != 0
          for module in mc_test_module.modules()
          if isinstance(module, torch.nn.Dropout)
      )
      assert any(
          isinstance(module, WeightDropLinear)
          for module in mc_test_module.modules()
      )
  
file_path: baal/tests/bayesian/dropconnect_test.py
imports: import warnings
  import pytest
  import torch
  from baal.bayesian.weight_drop import patch_module, WeightDropLinear, MCDropoutConnectModule, WeightDropConv2d
label_desc: Use image node_id 3 for calling a global function with example usage: test_patch_module_replaces_all_dropout_layers(inplace) without return types