code: def test_module_class_replaces_dropout_layers(
      a_model_with_dropout, is_deterministic
  ):
      dummy_input = torch.randn(8, 10)
      test_mc_module = baal.bayesian.dropout.MCDropoutModule(
          a_model_with_dropout
      )
  
      assert not any(
          isinstance(module, torch.nn.Dropout)
          for module in a_model_with_dropout.modules()
      )
      assert any(
          isinstance(module, baal.bayesian.dropout.Dropout)
          for module in a_model_with_dropout.modules()
      )
      torch.manual_seed(2019)
      assert not is_deterministic(test_mc_module, (8, 10))
  
      # Check that unpatch works
      module = test_mc_module.unpatch().eval()
      assert not any(
          isinstance(mod, baal.bayesian.dropout.Dropout)
          for mod in module.modules()
      )
      assert is_deterministic(module, (8, 10))
  
file_path: baal/tests/bayesian/dropout_test.py
imports: import warnings
  import pytest
  import torch
  import baal.bayesian.dropout
label_desc: Use image node_id 6 for calling a global function with example usage: test_module_class_replaces_dropout_layers(a_model_with_dropout, is_deterministic) without return types