code: def test_register_hooks_to_relu_layers(mocker, name, model_module):
      model = model_module()
      relu_layers = find_relu_layers(model, nn.ReLU)
  
      for layer in relu_layers:
          mocker.spy(layer, "register_forward_hook")
          mocker.spy(layer, "register_backward_hook")
  
      backprop = Backprop(model)
  
      target_class = 5
      input_ = torch.zeros([1, 3, 224, 224])
  
      if "inception" in name:
          input_ = torch.zeros([1, 3, 299, 299])
  
      make_mock_output(mocker, model, target_class)
  
      backprop.calculate_gradients(input_, target_class, guided=True)
  
      for layer in relu_layers:
          layer.register_forward_hook.assert_called_once()
          layer.register_backward_hook.assert_called_once()
  
imports: import inspect
  import pytest
  import torch
  import torch.nn
  import torch.nn.functional
  import torchvision.models
  from flashtorch.saliency import Backprop
label_desc: Use image node_id 20 for calling a global function with example usage: test_register_hooks_to_relu_layers(mocker, name, model_module) without return types