code: def _gradient_dot_product(
      input_grads: Tuple[Tensor], src_grads: Tuple[Tensor]
  ) -> Tensor:
      r"""
      Computes the dot product between the gradient vector for a model on an input batch
      and src batch, for each pairwise batch member. Gradients are passed in as a tuple
      corresponding to the trainable parameters returned by model.parameters(). Output
      corresponds to a tensor of size (inputs_batch_size, src_batch_size) with all
      pairwise dot products.
      """
  
      assert len(input_grads) == len(
          src_grads
      ), "Mismatching gradient parameters."
  
      iterator = zip(input_grads, src_grads)
      total = _tensor_batch_dot(*next(iterator))
      for input_grad, src_grad in iterator:
          total += _tensor_batch_dot(input_grad, src_grad)
  
      return total
  
imports: import warnings
  from functools import reduce
  from typing import Any, Callable, Iterable, List, NamedTuple, Optional, Tuple, TYPE_CHECKING, Union
  import torch
  import torch.nn
  from captum._utils.common import _get_module_from_name, _parse_version
  from captum._utils.gradient import _compute_jacobian_wrt_params, _compute_jacobian_wrt_params_with_sample_wise_trick
  from captum._utils.progress import progress
  from torch import Tensor
  from torch.nn import Module
  from torch.utils.data import DataLoader, Dataset
label_desc: Use image node_id 2 for calling a global function with example usage: _gradient_dot_product(input_grads, src_grads) and returns: total