code: def testGradientsRank2Slices(self):
      indices = constant_op.constant([[1], [0]], dtype=dtypes.int32)
      inputs = constant_op.constant(
          [[1, 2], [3, 4]], dtype=dtypes.float64
      )
      outputs = array_ops.gather_nd(inputs, indices)
  
      grad_vals = constant_op.constant(
          [[1, 2], [3, 4]], dtype=dtypes.float64
      )
      grads = gradients_impl.gradients(
          [outputs], [inputs], [grad_vals]
      )[0]
      expected_grads = np.array([[3, 4], [1, 2]], dtype=np.float64)
      with self.session():
          self.assertIndexedSlices(grads)
          self.assertAllEqual(
              expected_grads, ops.convert_to_tensor(grads)
          )
  
imports: import time
  import numpy
  from tensorflow.python.client import session
  from tensorflow.python.eager import context
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import indexed_slices
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor_shape
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import gradients_impl
  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 19 for calling the GatherNdTest obj's underlying member method code with example usage: obj.testGradientsRank2Slices() without return types