code: def _batched_operator(
      operator: Callable[..., TupleOrTensorOrBoolGeneric],
      inputs: TensorOrTupleOfTensorsGeneric,
      additional_forward_args: Any = None,
      target_ind: TargetType = None,
      internal_batch_size: Union[None, int] = None,
      **kwargs: Any,
  ) -> TupleOrTensorOrBoolGeneric:
      """
      Batches the operation of the given operator, applying the given batch size
      to inputs and additional forward arguments, and returning the concatenation
      of the results of each batch.
      """
      all_outputs = [
          operator(
              inputs=input,
              additional_forward_args=additional,
              target_ind=target,
              **kwargs,
          )
          for input, additional, target in _batched_generator(
              inputs,
              additional_forward_args,
              target_ind,
              internal_batch_size,
          )
      ]
      return _reduce_list(all_outputs)
  
file_path: captum/captum/attr/_utils/batching.py
imports: import typing
  import warnings
  from typing import Any, Callable, Iterator, Tuple, Union
  import torch
  from captum._utils.common import _format_additional_forward_args, _format_output, _format_tensor_into_tuples, _reduce_list
  from captum._utils.typing import TargetType, TensorOrTupleOfTensorsGeneric, TupleOrTensorOrBoolGeneric
  from captum.attr._utils.approximation_methods import approximation_parameters
  from torch import Tensor
label_desc: Use image node_id 6 for calling a global function with example usage: _batched_operator(operator, inputs, additional_forward_args, target_ind, internal_batch_size) and returns: _reduce_list