code: def _add_activation_collector(self, pruner):
      def collector(collected_activation):
          def hook(module_, input_, output):
              collected_activation.append(
                  pruner.activation(output.detach().cpu())
              )
  
          return hook
  
      pruner.collected_activation = {}
      pruner._fwd_hook_id += 1
      pruner._fwd_hook_handles[pruner._fwd_hook_id] = []
  
      for wrapper_idx, wrapper in enumerate(
          pruner.get_modules_wrapper()
      ):
          pruner.collected_activation[wrapper_idx] = []
          handle = wrapper.register_forward_hook(
              collector(pruner.collected_activation[wrapper_idx])
          )
  
          pruner._fwd_hook_handles[pruner._fwd_hook_id].append(handle)
      return pruner._fwd_hook_id
  
imports: import logging
  import math
  import numpy
  import torch
  from .weight_masker import WeightMasker
label_desc: Use image node_id 2 for calling the ActivationFilterPrunerMasker obj's underlying member method code with example usage: obj._add_activation_collector(pruner) and returns: pruner, hook