code: def ft_compute_per_sample_gradient(layer, activations, backprops):
      """
      Compute the per-sample gradient of the layer.
      Args:
          layer: the layer on which to compute the gradient
          activations: the input to the layer
          backprops: the  gradient of the loss w.r.t. outputs of the layer
      """
      parameters = list(layer.parameters(recurse=True))
      if not hasattr(layer, "ft_compute_sample_grad"):
          prepare_layer(layer)
  
      per_sample_grads = layer.ft_compute_sample_grad(
          parameters, activations[0], backprops
      )
  
      ret = {}
      for i_p, p in enumerate(parameters):
          ret[p] = per_sample_grads[i_p]
  
      return ret
  
file_path: opacus/opacus/grad_sample/functorch.py
imports: import copy
  import torch
  import torch.nn
  from opacus.layers.dp_rnn import RNNLinear
  from torch.func import grad, vmap
label_desc: Use image node_id 3 for calling a global function with example usage: ft_compute_per_sample_gradient(layer, activations, backprops) and returns: ret