code: def test_batched_operator(self) -> None:
      def _sample_operator(
          inputs, additional_forward_args, target_ind, scale
      ):
          return (
              scale * (sum(inputs)),
              scale * sum(additional_forward_args) + target_ind[0],
          )
  
      inp1 = torch.tensor([[0, 1, 2], [3, 4, 5], [6, 7, 8]])
      inp2 = torch.tensor([[6, 7, 8], [0, 1, 2], [3, 4, 5]])
      inp3 = torch.tensor([[0, 1, 2], [0, 0, 0], [0, 0, 0]])
      batched_result = _batched_operator(
          _sample_operator,
          inputs=(inp1, inp2),
          additional_forward_args=(inp3),
          target_ind=[0, 1, 2],
          scale=2.0,
          internal_batch_size=1,
      )
      assertTensorAlmostEqual(
          self,
          batched_result[0],
          [[12, 16, 20], [6, 10, 14], [18, 22, 26]],
      )
      assertTensorAlmostEqual(
          self, batched_result[1], [[0, 2, 4], [1, 1, 1], [2, 2, 2]]
      )
  
file_path: captum/tests/attr/test_utils_batching.py
imports: import torch
  from captum.attr._utils.batching import _batched_generator, _batched_operator, _tuple_splice_range
  from tests.helpers.basic import assertTensorAlmostEqual, BaseTest
label_desc: Use image node_id 5 for calling the Test obj's underlying member method code with example usage: obj.test_batched_operator() and returns: unknown,  unknown