class_docstr: ATTENTION:
      Currently, innvestigating a network only works if all
      layers that have to be inverted are specified explicitly
      and registered as a module. If., for example,
      only the functional max_poolnd is used, the inversion will not work.
class_docstr_tok: ["ATTENTION",":","Currently",",","innvestigating","a","network","only","works","if","all","layers","that","have","to","be","inverted","are","specified","explicitly","and","registered","as","a","module",".","If.",",","for","example",",","only","the","functional","max_poolnd","is","used",",","the","inversion","will","not","work","."]
docstr: Recursively unrolls a model and registers the required
  hooks to save all the necessary values for LRP in the forward pass.
  
  Args:
      parent_module: Model to unroll and register hooks for.
  
  Returns:
      None
docstr_tok: ["Recursively","unrolls","a","model","and","registers","the","required","hooks","to","save","all","the","necessary","values","for","LRP","in","the","forward","pass",".","Args",":","parent_module",":","Model","to","unroll","and","register","hooks","for",".","Returns",":","None"]
code: def register_hooks(self, parent_module):
      """
      Recursively unrolls a model and registers the required
      hooks to save all the necessary values for LRP in the forward pass.
  
      Args:
          parent_module: Model to unroll and register hooks for.
  
      Returns:
          None
  
      """
      for mod in parent_module.children():
          if list(mod.children()):
              self.register_hooks(mod)
              continue
          mod.register_forward_hook(
              self.inverter.get_layer_fwd_hook(mod)
          )
          if isinstance(mod, torch.nn.ReLU):
              mod.register_backward_hook(self.relu_hook_function)
  
file_path: tensorwatch/tensorwatch/saliency/epsilon_lrp.py
imports: import torch
  import numpy
  from .inverter_util import RelevancePropagator
label_desc: Use image node_id 4 for calling the InnvestigateModel obj's underlying member method code with example usage: obj.register_hooks(parent_module) without return types