code: def testGradientsRank7Elements(self):
      # Shape [1,1,2,1,1,2,2]
      indices = constant_op.constant(
          [
              [
                  [
                      [[[[0, 0, 0, 0, 0, 1], [0, 0, 1, 0, 0, 0]]]],
                      [[[[0, 0, 0, 0, 0, 0], [0, 0, 1, 0, 0, 1]]]],
                  ]
              ]
          ],
          dtype=dtypes.int32,
      )
      inputs = constant_op.constant(
          [[[[[[[1, 3], [5, 7]]]], [[[[2, 4], [6, 8]]]]]]],
          dtype=dtypes.float64,
      )
      outputs = array_ops.gather_nd(inputs, indices)
  
      grad_vals = constant_op.constant(
          [[[[[[[1, 2], [3, 4]]]], [[[[5, 6], [7, 8]]]]]]],
          dtype=dtypes.float64,
      )
      grads = gradients_impl.gradients(
          [outputs], [inputs], [grad_vals]
      )[0]
      expected_grads = np.array(
          [[[[[[[5, 6], [1, 2]]]], [[[[3, 4], [7, 8]]]]]]],
          dtype=np.float64,
      )
      with self.session():
          self.assertAllEqual(expected_grads, self.evaluate(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 21 for calling the GatherNdTest obj's underlying member method code with example usage: obj.testGradientsRank7Elements() without return types