class_docstr: A class used to get weights and activations from specified layers from a Pytorch model.
class_docstr_tok: ["A","class","used","to","get","weights","and","activations","from","specified","layers","from","a","Pytorch","model","."]
docstr: Register hook to a layer, given layer_name, to obtain activations.
  Args:
      layer_name (str): name of the layer.
docstr_tok: ["Register","hook","to","a","layer",",","given","layer_name",",","to","obtain","activations",".","Args",":","layer_name","(","str",")",":","name","of","the","layer","."]
code: def _register_single_hook(self, layer_name):
      """
      Register hook to a layer, given layer_name, to obtain activations.
      Args:
          layer_name (str): name of the layer.
      """
  
      def hook_fn(module, input, output):
          self.hooks[layer_name] = output.clone().detach()
  
      layer = get_layer(self.model, layer_name)
      layer.register_forward_hook(hook_fn)
  
imports: import itertools
  import numpy
  import matplotlib.pyplot
  import torch
  from sklearn.metrics import confusion_matrix
  import slowfast.utils.logging
  from slowfast.datasets.utils import pack_pathway_output, tensor_normalize
label_desc: Use image node_id 3 for calling the GetWeightAndActivation obj's underlying member method code with example usage: obj._register_single_hook(layer_name) without return types