code: def testScalar1D(self):
      with self.cached_session():
          data = np.array([0, 1, 2, 3, 7, 5])
          for dtype in _TEST_TYPES:
              for itype in _INDEX_TYPES:
                  for indices in 4, [1, 2, 2, 4, 5]:
                      with self.subTest(
                          dtype=dtype, itype=itype, indices=indices
                      ):
                          params_np = self._buildParams(data, dtype)
                          params = constant_op.constant(params_np)
                          indices_tf = constant_op.constant(
                              indices, dtype=itype
                          )
                          gather_t = array_ops.gather(
                              params, indices_tf
                          )
                          gather_val = self.evaluate(gather_t)
                          np_val = params_np[indices]
                          self.assertAllEqual(np_val, gather_val)
                          self.assertEqual(
                              np_val.shape, gather_t.get_shape()
                          )
  
imports: from absl.testing import parameterized
  import numpy
  from tensorflow.python.eager import backprop
  from tensorflow.python.eager import def_function
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import indexed_slices
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor_spec
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import gradient_checker_v2
  from tensorflow.python.ops import gradients_impl
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import ref_variable
  from tensorflow.python.ops import resource_variable_ops
  from tensorflow.python.ops import variables
  from tensorflow.python.platform import test
label_desc: Use image node_id 2 for calling the GatherTest obj's underlying member method code with example usage: obj.testScalar1D() without return types