code: def _influence_batch_intermediate_quantities_influence_function(
      influence_inst: "IntermediateQuantitiesInfluenceFunction",
      test_batch: Tuple[Any, ...],
      train_batch: Tuple[Any, ...],
  ):
      """
      computes influence of a test batch on a train batch, for implementations of
      `IntermediateQuantitiesInfluenceFunction`
      """
      return torch.matmul(
          influence_inst.compute_intermediate_quantities(test_batch),
          influence_inst.compute_intermediate_quantities(train_batch).T,
      )
  
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 14 for calling a global function with example usage: _influence_batch_intermediate_quantities_influence_function(influence_inst, test_batch, train_batch) and returns: torch