class_docstr: Base class for all propagation rule classes, also called Z-Rule.
  STABILITY_FACTOR is used to assure that no zero divison occurs.
class_docstr_tok: ["Base","class","for","all","propagation","rule","classes",",","also","called","Z-Rule",".","STABILITY_FACTOR","is","used","to","assure","that","no","zero","divison","occurs","."]
docstr: Register backward hooks on input and output
  tensors of linear layers in the model.
docstr_tok: ["Register","backward","hooks","on","input","and","output","tensors","of","linear","layers","in","the","model","."]
code: def forward_hook(self, module, inputs, outputs):
      """Register backward hooks on input and output
      tensors of linear layers in the model."""
      inputs = _format_tensor_into_tuples(inputs)
      self._has_single_input = len(inputs) == 1
      self._handle_input_hooks = []
      for input in inputs:
          if not hasattr(input, "hook_registered"):
              input_hook = self._create_backward_hook_input(input.data)
              self._handle_input_hooks.append(
                  input.register_hook(input_hook)
              )
              input.hook_registered = True
      output_hook = self._create_backward_hook_output(outputs.data)
      self._handle_output_hook = outputs.register_hook(output_hook)
      return outputs.clone()
  
imports: from abc import ABC, abstractmethod
  import torch
  from ..._utils.common import _format_tensor_into_tuples
label_desc: Use image node_id 1 for calling the PropagationRule obj's underlying member method code with example usage: obj.forward_hook(module, inputs, outputs) and returns: outputs