docstr: For each tensor in a list of input tensors,
  calculates the attributions for each feature or element of layer.
  
  Parameters
  ----------
  X
      Instance for which integrated gradients attribution are computed.
  baselines
      Baselines (starting point of the path integral) for each instance.
  target
      Defines which element of the model output is considered to compute the gradients.
  step_sizes
      Weights in the path integral sum.
  alphas
      Interpolation parameter defining the points of the integral path.
  nb_samples
      Total number of samples.
  forward_kwargs
      Input keywords args.
  compute_layer_inputs_gradients
      In case of layers gradients, controls whether the gradients are computed for the layer's inputs or
      outputs. If ``True``, gradients are computed for the layer's inputs, if ``False`` for the layer's outputs.
  
  Returns
  -------
  Tuple with integrated gradients attributions, deltas and predictions.
docstr_tok: ["For","each","tensor","in","a","list","of","input","tensors",",","calculates","the","attributions","for","each","feature","or","element","of","layer",".","Parameters","--","--","--","--","--","X","Instance","for","which","integrated","gradients","attribution","are","computed",".","baselines","Baselines","(","starting","point","of","the","path","integral",")","for","each","instance",".","target","Defines","which","element","of","the","model","output","is","considered","to","compute","the","gradients",".","step_sizes","Weights","in","the","path","integral","sum",".","alphas","Interpolation","parameter","defining","the","points","of","the","integral","path",".","nb_samples","Total","number","of","samples",".","forward_kwargs","Input","keywords","args",".","compute_layer_inputs_gradients","In","case","of","layers","gradients",",","controls","whether","the","gradients","are","computed","for","the","layer","'s","inputs","or","outputs",".","If","``","True","``",",","gradients","are","computed","for","the","layer","'s","inputs",",","if","``","False","``","for","the","layer","'s","outputs",".","Returns","--","--","--","-","Tuple","with","integrated","gradients","attributions",",","deltas","and","predictions","."]
code: def _compute_attributions_list_input(
      self,
      X: List[np.ndarray],
      baselines: Union[List[int], List[float], List[np.ndarray]],
      target: Optional[np.ndarray],
      step_sizes: List[float],
      alphas: List[float],
      nb_samples: int,
      forward_kwargs: Optional[dict],
      compute_layer_inputs_gradients: bool,
  ) -> List:
      """For each tensor in a list of input tensors,
      calculates the attributions for each feature or element of layer.
  
      Parameters
      ----------
      X
          Instance for which integrated gradients attribution are computed.
      baselines
          Baselines (starting point of the path integral) for each instance.
      target
          Defines which element of the model output is considered to compute the gradients.
      step_sizes
          Weights in the path integral sum.
      alphas
          Interpolation parameter defining the points of the integral path.
      nb_samples
          Total number of samples.
      forward_kwargs
          Input keywords args.
      compute_layer_inputs_gradients
          In case of layers gradients, controls whether the gradients are computed for the layer's inputs or
          outputs. If ``True``, gradients are computed for the layer's inputs, if ``False`` for the layer's outputs.
  
      Returns
      -------
      Tuple with integrated gradients attributions, deltas and predictions.
  
      """
      if forward_kwargs is None:
          forward_kwargs = {}
      attrs_dtypes = [xx.dtype for xx in X]
  
      # define paths in features' space
      paths = []
      for i in range(len(X)):
          x, baseline = X[i], baselines[i]
          # construct paths
          path = np.concatenate(
              [
                  baseline + alphas[i] * (x - baseline)
                  for i in range(self.n_steps)
              ],
              axis=0,
          )
          paths.append(path)
  
      if forward_kwargs:
          paths_kwargs: Optional[dict] = {
              k: np.concatenate(
                  [forward_kwargs[k] for _ in range(self.n_steps)],
                  axis=0,
              )
              for k in forward_kwargs.keys()
          }
      else:
          paths_kwargs = None
  
      # define target paths
      if target is not None:
          target_paths = np.concatenate(
              [target for _ in range(self.n_steps)], axis=0
          )
      else:
          target_paths = None
  
      if forward_kwargs:
          if target_paths is not None:
              ds_args = tuple(p for p in paths) + (
                  paths_kwargs,
                  target_paths,
              )
          else:
              ds_args = tuple(p for p in paths) + (paths_kwargs,)
  
      else:
          if target_paths is not None:
              ds_args = tuple(p for p in paths) + (target_paths,)
          else:
              ds_args = tuple(p for p in paths)
  
      paths_ds = tf.data.Dataset.from_tensor_slices(ds_args).batch(
          self.internal_batch_size
      )
      paths_ds.as_numpy_iterator()
      paths_ds.prefetch(tf.data.experimental.AUTOTUNE)
  
      # calculate gradients for batches
      batches = []
      for path in paths_ds:
          if forward_kwargs:
              if target is not None:
                  paths_b, kwargs_b, target_b = (
                      path[:-2],
                      path[-2],
                      path[-1],
                  )
              else:
                  paths_b, kwargs_b = path
                  target_b = None
          else:
              if target is not None:
                  paths_b, target_b = path[:-1], path[-1]
                  kwargs_b = None
              else:
                  paths_b, kwargs_b, target_b = path, None, None
  
          paths_b = [
              tf.dtypes.cast(paths_b[i], attrs_dtypes[i])
              for i in range(len(paths_b))
          ]
  
          if self.layer is None:
              grads_b = _gradients_input(
                  self.model, paths_b, target_b, forward_kwargs=kwargs_b
              )
          else:
              grads_b = _gradients_layer(
                  self.model,
                  self.layer,
                  self.orig_call,  # type: ignore[arg-type]
                  self.orig_dummy_input,  # type: ignore[arg-type]
                  paths_b,
                  target_b,
                  forward_kwargs=kwargs_b,
                  compute_layer_inputs_gradients=compute_layer_inputs_gradients,
              )
  
          batches.append(grads_b)
  
      # multi-input
      batches = [
          [batches[i][j] for i in range(len(batches))]
          for j in range(len(attrs_dtypes))
      ]
  
      # calculate attributions from gradients batches
      attributions = []
      for j in range(len(attrs_dtypes)):
          sum_int = _calculate_sum_int(
              batches,
              self.model,
              target,
              target_paths,
              self.n_steps,
              nb_samples,
              step_sizes,
              j,
          )
          norm = X[j] - baselines[j]
          attribution = norm * sum_int
          attributions.append(attribution)
  
      return attributions
  
imports: import copy
  import logging
  import string
  import warnings
  from enum import Enum
  from typing import Callable, List, Optional, Tuple, Union, cast
  import numpy
  import tensorflow
  from alibi.api.defaults import DEFAULT_DATA_INTGRAD, DEFAULT_META_INTGRAD
  from alibi.api.interfaces import Explainer, Explanation
  from alibi.utils.approximation_methods import approximation_parameters
label_desc: Use image node_id 5 for calling the IntegratedGradients obj's underlying member method code with example usage: obj._compute_attributions_list_input(X, baselines, target, step_sizes, alphas, nb_samples, forward_kwargs, compute_layer_inputs_gradients) and returns: attributions