code: def testRaggedGatherNdUnknownRankError(self):
      if context.executing_eagerly():
          return
      params = ragged_factory_ops.constant([["a", "b"], ["c", "d"]])
      indices1 = array_ops.placeholder(dtypes.int32, shape=None)
      indices2 = array_ops.placeholder(dtypes.int32, shape=[None])
  
      with self.assertRaisesRegex(
          ValueError, "indices.rank be statically known."
      ):
          ragged_gather_ops.gather_nd(params, indices1)
      with self.assertRaisesRegex(
          ValueError, r"indices.shape\[-1\] must be statically known."
      ):
          ragged_gather_ops.gather_nd(params, indices2)
  
file_path: tensorflow-upstream/tensorflow/python/ops/ragged/ragged_gather_nd_op_test.py
imports: from absl.testing import parameterized
  import numpy
  from tensorflow.python.eager import context
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops.ragged import ragged_factory_ops
  from tensorflow.python.ops.ragged import ragged_gather_ops
  from tensorflow.python.platform import googletest
label_desc: Use image node_id 2 for calling the RaggedGatherNdOpTest obj's underlying member method code with example usage: obj.testRaggedGatherNdUnknownRankError() without return types