docstr: Check that scalar and empty indices shapes work as well.
docstr_tok: ["Check","that","scalar","and","empty","indices","shapes","work","as","well","."]
code: def testHigherRank(self):
      """Check that scalar and empty indices shapes work as well."""
      shape = (2, 1, 3, 2)
      for indices_shape in (), (0,), (2, 0), (2, 3):
          for dtype in self.all_tf_types:
              for axis in 0, 1, 2, 3, -1, -2:
                  params = self._buildParams(
                      np.random.randn(*shape), dtype
                  )
                  indices = np.random.randint(
                      shape[axis], size=indices_shape
                  )
                  with self.session() as sess, self.test_scope():
                      tf_params = array_ops.placeholder(dtype=dtype)
                      tf_indices = constant_op.constant(
                          indices, dtype=dtypes.int32
                      )
                      gather = array_ops.gather(
                          tf_params, tf_indices, axis=axis
                      )
                      gather_value = sess.run(
                          gather, feed_dict={tf_params: params}
                      )
                      gather_np = constant_op.constant(
                          np.take(params, indices, axis=axis), dtype
                      )
                      self.assertAllEqual(gather_np, gather_value)
  
imports: import numpy
  from tensorflow.compiler.tests import xla_test
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import variables
  from tensorflow.python.platform import flags
  from tensorflow.python.platform import test
label_desc: Use image node_id 6 for calling the GatherTest obj's underlying member method code with example usage: obj.testHigherRank() without return types