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: Save initial activations a_j before modules are changed
docstr_tok: ["Save","initial","activations","a_j","before","modules","are","changed"]
code: def forward_hook_weights(self, module, inputs, outputs):
      """Save initial activations a_j before modules are changed"""
      device = (
          inputs[0].device
          if isinstance(inputs, tuple)
          else inputs.device
      )
      if (
          hasattr(module, "activations")
          and device in module.activations
      ):
          raise RuntimeError(
              "Module {} is being used more than once in the network, which "
              "is not supported by LRP. "
              "Please ensure that module is being used only once in the "
              "network.".format(module)
          )
      module.activations[device] = tuple(input.data for input in inputs)
      self._manipulate_weights(module, inputs, outputs)
  
imports: from abc import ABC, abstractmethod
  import torch
  from ..._utils.common import _format_tensor_into_tuples
label_desc: Use image node_id 5 for calling the PropagationRule obj's underlying member method code with example usage: obj.forward_hook_weights(module, inputs, outputs) without return types