code: def test_patch_module_replaces_all_dropout_layers(
      inplace, a_model_with_dropout
  ):
      test_module = a_model_with_dropout
  
      mc_test_module = baal.bayesian.consistent_dropout.patch_module(
          test_module, inplace=inplace
      )
  
      # objects should be the same if inplace is True and not otherwise:
      assert (mc_test_module is test_module) == inplace
      assert not any(
          isinstance(module, torch.nn.Dropout)
          for module in mc_test_module.modules()
      )
      assert any(
          isinstance(
              module, baal.bayesian.consistent_dropout.ConsistentDropout
          )
          for module in mc_test_module.modules()
      )
  
file_path: baal/tests/bayesian/consistent_dropout_test.py
imports: import warnings
  from copy import deepcopy
  import pytest
  import torch
  import baal.bayesian.consistent_dropout
label_desc: Use image node_id 4 for calling a global function with example usage: test_patch_module_replaces_all_dropout_layers(inplace, a_model_with_dropout) without return types