docstr: For instances of TracInCP, computation of influence scores or self influence
  scores repeatedly calls this function for different checkpoints
  and batches. In particular, this function computes the jacobian of a loss
  function w.r.t. parameters in the `layers` initialization argument.
  
  Args:
  
      inputs (tuple[Any, ...]): A batch of examples, which could be a training
              batch or test batch, depending which method is the caller. Does not
              represent labels, which are passed as `targets`. The assumption is
              that `model(*inputs)` produces the predictions for the batch.
      targets (tensor or None): If computing influence scores on a loss function,
              these are the labels corresponding to the batch `inputs`.
              Default: none
      loss_fn (Callable, optional): The loss function to use when computing the
              jacobian.
      reduction_type (str, optional): The reduction type of `loss_fn`. This
              argument is only used if `sample_wise_grads_per_batch` was true in
              initialization.
docstr_tok: ["For","instances","of","TracInCP",",","computation","of","influence","scores","or","self","influence","scores","repeatedly","calls","this","function","for","different","checkpoints","and","batches",".","In","particular",",","this","function","computes","the","jacobian","of","a","loss","function","w.r.t",".","parameters","in","the","`","layers","`","initialization","argument",".","Args",":","inputs","(","tuple","[","Any",",","...","]",")",":","A","batch","of","examples",",","which","could","be","a","training","batch","or","test","batch",",","depending","which","method","is","the","caller",".","Does","not","represent","labels",",","which","are","passed","as","`","targets","`",".","The","assumption","is","that","`","model","(","*","inputs",")","`","produces","the","predictions","for","the","batch",".","targets","(","tensor","or","None",")",":","If","computing","influence","scores","on","a","loss","function",",","these","are","the","labels","corresponding","to","the","batch","`","inputs","`",".","Default",":","none","loss_fn","(","Callable",",","optional",")",":","The","loss","function","to","use","when","computing","the","jacobian",".","reduction_type","(","str",",","optional",")",":","The","reduction","type","of","`","loss_fn","`",".","This","argument","is","only","used","if","`","sample_wise_grads_per_batch","`","was","true","in","initialization","."]
code: def _basic_computation_tracincp(
      self,
      inputs: Tuple[Any, ...],
      targets: Optional[Tensor] = None,
      loss_fn: Optional[Union[Module, Callable]] = None,
      reduction_type: Optional[str] = None,
  ) -> Tuple[Tensor, ...]:
      """
      For instances of TracInCP, computation of influence scores or self influence
      scores repeatedly calls this function for different checkpoints
      and batches. In particular, this function computes the jacobian of a loss
      function w.r.t. parameters in the `layers` initialization argument.
  
      Args:
  
          inputs (tuple[Any, ...]): A batch of examples, which could be a training
                  batch or test batch, depending which method is the caller. Does not
                  represent labels, which are passed as `targets`. The assumption is
                  that `model(*inputs)` produces the predictions for the batch.
          targets (tensor or None): If computing influence scores on a loss function,
                  these are the labels corresponding to the batch `inputs`.
                  Default: none
          loss_fn (Callable, optional): The loss function to use when computing the
                  jacobian.
          reduction_type (str, optional): The reduction type of `loss_fn`. This
                  argument is only used if `sample_wise_grads_per_batch` was true in
                  initialization.
      """
      return _compute_jacobian_sample_wise_grads_per_batch(
          self, inputs, targets, loss_fn, reduction_type
      )
  
imports: import glob
  import warnings
  from abc import abstractmethod
  from os.path import join
  from typing import Any, Callable, Iterator, List, Optional, Tuple, Type, Union
  import torch
  from captum._utils.av import AV
  from captum._utils.common import _parse_version
  from captum._utils.progress import NullProgress, progress
  from captum.influence._core.influence import DataInfluence
  from captum.influence._utils.common import _check_loss_fn, _compute_jacobian_sample_wise_grads_per_batch, _format_inputs_dataset, _get_k_most_influential_helper, _gradient_dot_product, _influence_route_to_helpers, _load_flexible_state_dict, _self_influence_by_batches_helper, _set_active_parameters, KMostInfluentialResults
  from captum.log import log_usage
  from torch import Tensor
  from torch.nn import Module
  from torch.utils.data import DataLoader, Dataset
label_desc: Use image node_id 12 for calling the TracInCP obj's underlying member method code with example usage: obj._basic_computation_tracincp(inputs, targets, loss_fn, reduction_type) and returns: _compute_jacobian_sample_wise_grads_per_batch