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: Obtain all activations from layers that we register hooks for.
  Args:
      input (tensors, list of tensors): the model input.
      bboxes (Optional): Bouding boxes data that might be required
          by the model.
  Returns:
      activation_dict (Python dictionary): a dictionary of the pair
          {layer_name: list of activations}, where activations are outputs returned
          by the layer.
docstr_tok: ["Obtain","all","activations","from","layers","that","we","register","hooks","for",".","Args",":","input","(","tensors",",","list","of","tensors",")",":","the","model","input",".","bboxes","(","Optional",")",":","Bouding","boxes","data","that","might","be","required","by","the","model",".","Returns",":","activation_dict","(","Python","dictionary",")",":","a","dictionary","of","the","pair","{","layer_name",":","list","of","activations","}",",","where","activations","are","outputs","returned","by","the","layer","."]
code: def get_activations(self, input, bboxes=None):
      """
      Obtain all activations from layers that we register hooks for.
      Args:
          input (tensors, list of tensors): the model input.
          bboxes (Optional): Bouding boxes data that might be required
              by the model.
      Returns:
          activation_dict (Python dictionary): a dictionary of the pair
              {layer_name: list of activations}, where activations are outputs returned
              by the layer.
      """
      input_clone = [inp.clone() for inp in input]
      if bboxes is not None:
          preds = self.model(input_clone, bboxes)
      else:
          preds = self.model(input_clone)
  
      activation_dict = {}
      for layer_name, hook in self.hooks.items():
          # list of activations for each instance.
          activation_dict[layer_name] = hook
  
      return activation_dict, preds
  
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 5 for calling the GetWeightAndActivation obj's underlying member method code with example usage: obj.get_activations(input, bboxes) and returns: activation_dict,  preds