class_docstr: Class for extracting activations and
  registering gradients from targeted intermediate layers 
code: def save_gradient(self, module, grad_input, grad_output):
      # Gradients are computed in reverse order
      grad = grad_output[0]
      if self.reshape_transform is not None:
          grad = self.reshape_transform(grad)
      self.gradients = [grad.cpu().detach()] + self.gradients
  
imports: import cv2
  import numpy
label_desc: Use image node_id 3 for calling the ActivationsAndGradients obj's underlying member method code with example usage: obj.save_gradient(module, grad_input, grad_output) without return types