code: def test_patch_module_raise_warnings(inplace, layers):
      test_module = torch.nn.Sequential(
          torch.nn.Linear(10, 5),
          torch.nn.ReLU(),
          torch.nn.Linear(5, 2),
      )
  
      with warnings.catch_warnings(record=True) as w:
          mc_test_module = patch_module(
              test_module,
              layers=layers,
              weight_dropout=0.2,
              inplace=inplace,
          )
          assert len(w) == 1
          assert issubclass(w[-1].category, UserWarning)
          assert "No layer was modified by patch_module" in str(
              w[-1].message
          )
  
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 2 for calling a global function with example usage: test_patch_module_raise_warnings(inplace, layers) without return types