code: def test_reduce_sum_vectorized(self):
      values = torch.as_tensor(
          [[1.0, 2.0, 3.0], [2.0, 3.0, 4.0], [3.0, 4.0, 5.0]]
      )
      index = IndexMap(
          indices=torch.as_tensor([[0, 0, 1]]),
          num_segments=2,
          batch_dims=0,
      )
      sums, new_index = reduce_sum(values, index)
  
      # We use np.testing.assert_allclose rather than Tensorflow's assertAllClose
      np.testing.assert_allclose(sums.numpy(), [3.0, 3.0])
      # We use np.testing.assert_array_equal rather than Tensorflow's assertAllEqual
      np.testing.assert_array_equal(new_index.indices.numpy(), [0, 1])
      np.testing.assert_array_equal(new_index.num_segments.numpy(), 2)
      np.testing.assert_array_equal(new_index.batch_dims, 0)
  
imports: import copy
  import unittest
  import numpy
  import pandas
  from transformers import MODEL_FOR_CAUSAL_LM_MAPPING, MODEL_FOR_MASKED_LM_MAPPING, MODEL_FOR_MULTIPLE_CHOICE_MAPPING, MODEL_FOR_NEXT_SENTENCE_PREDICTION_MAPPING, MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING, MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING, MODEL_FOR_TABLE_QUESTION_ANSWERING_MAPPING, MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING, TapasConfig, is_torch_available
  from transformers.models.auto import get_values
  from transformers.testing_utils import require_tensorflow_probability, require_torch, slow, torch_device
  from transformers.utils import cached_property
  from ...test_configuration_common import ConfigTester
  from ...test_modeling_common import ModelTesterMixin, floats_tensor, ids_tensor, random_attention_mask
  from ...test_pipeline_mixin import PipelineTesterMixin
label_desc: Use image node_id 8 for calling the TapasUtilitiesTest obj's underlying member method code with example usage: obj.test_reduce_sum_vectorized() without return types