docstr: Constructs batch of inputs to be attributed and visualized.
  
  Args:
  
      inputs (Tensor or tuple[Tensor, ...]): Batch of inputs for a model.
                  These may be either a Tensor or tuple of tensors. Each tensor
                  must correspond to a feature for AttributionVisualizer, and
                  the corresponding input transform function of the feature
                  is applied to each input tensor prior to passing it to the
                  model. It is assumed that the first dimension of each
                  input tensor corresponds to the number of examples
                  (batch size) and is aligned for all input tensors.
      labels (Tensor): Tensor containing correct labels for input examples.
                  This must be a 1D tensor with length matching the first
                  dimension of each input tensor.
      additional_args (tuple, optional): If the forward function
                  requires additional arguments other than the inputs for
                  which attributions should not be computed, this argument
                  can be provided. It must be either a single additional
                  argument of a Tensor or arbitrary (non-tuple) type or a
                  tuple containing multiple additional arguments including
                  tensors or any arbitrary python types. These arguments
                  are provided to ``forward_func`` in order following the
                  arguments in inputs.
                  For a tensor, the first dimension of the tensor must
                  correspond to the number of examples.
docstr_tok: ["Constructs","batch","of","inputs","to","be","attributed","and","visualized",".","Args",":","inputs","(","Tensor","or","tuple","[","Tensor",",","...","]",")",":","Batch","of","inputs","for","a","model",".","These","may","be","either","a","Tensor","or","tuple","of","tensors",".","Each","tensor","must","correspond","to","a","feature","for","AttributionVisualizer",",","and","the","corresponding","input","transform","function","of","the","feature","is","applied","to","each","input","tensor","prior","to","passing","it","to","the","model",".","It","is","assumed","that","the","first","dimension","of","each","input","tensor","corresponds","to","the","number","of","examples","(","batch","size",")","and","is","aligned","for","all","input","tensors",".","labels","(","Tensor",")",":","Tensor","containing","correct","labels","for","input","examples",".","This","must","be","a","1D","tensor","with","length","matching","the","first","dimension","of","each","input","tensor",".","additional_args","(","tuple",",","optional",")",":","If","the","forward","function","requires","additional","arguments","other","than","the","inputs","for","which","attributions","should","not","be","computed",",","this","argument","can","be","provided",".","It","must","be","either","a","single","additional","argument","of","a","Tensor","or","arbitrary","(","non-tuple",")","type","or","a","tuple","containing","multiple","additional","arguments","including","tensors","or","any","arbitrary","python","types",".","These","arguments","are","provided","to","``","forward_func","``","in","order","following","the","arguments","in","inputs",".","For","a","tensor",",","the","first","dimension","of","the","tensor","must","correspond","to","the","number","of","examples","."]
code: def __init__(
      self,
      inputs: Union[Tensor, Tuple[Tensor, ...]],
      labels: Optional[Tensor],
      additional_args=None,
  ) -> None:
      r"""
      Constructs batch of inputs to be attributed and visualized.
  
      Args:
  
          inputs (Tensor or tuple[Tensor, ...]): Batch of inputs for a model.
                      These may be either a Tensor or tuple of tensors. Each tensor
                      must correspond to a feature for AttributionVisualizer, and
                      the corresponding input transform function of the feature
                      is applied to each input tensor prior to passing it to the
                      model. It is assumed that the first dimension of each
                      input tensor corresponds to the number of examples
                      (batch size) and is aligned for all input tensors.
          labels (Tensor): Tensor containing correct labels for input examples.
                      This must be a 1D tensor with length matching the first
                      dimension of each input tensor.
          additional_args (tuple, optional): If the forward function
                      requires additional arguments other than the inputs for
                      which attributions should not be computed, this argument
                      can be provided. It must be either a single additional
                      argument of a Tensor or arbitrary (non-tuple) type or a
                      tuple containing multiple additional arguments including
                      tensors or any arbitrary python types. These arguments
                      are provided to ``forward_func`` in order following the
                      arguments in inputs.
                      For a tensor, the first dimension of the tensor must
                      correspond to the number of examples.
      """
      self.inputs = inputs
      self.labels = labels
      self.additional_args = additional_args
  
imports: from collections import namedtuple
  from itertools import cycle
  from typing import Any, Callable, Dict, Iterable, List, NamedTuple, Optional, Tuple, Union
  import torch
  from captum.attr import IntegratedGradients
  from captum.attr._utils.batching import _batched_generator
  from captum.insights.attr_vis.attribution_calculation import AttributionCalculation, OutputScore
  from captum.insights.attr_vis.config import ATTRIBUTION_METHOD_CONFIG, ATTRIBUTION_NAMES_TO_METHODS
  from captum.insights.attr_vis.features import BaseFeature
  from captum.insights.attr_vis.server import namedtuple_to_dict
  from captum.log import log_usage
  from torch import Tensor
  from torch.nn import Module
label_desc: Use image node_id 1 to create a new Batch object  with example: obj = Batch(inputs, labels, additional_args)