code: def test_unknown_rank_error(self):
      # Use a tf.function that erases shape information.
      @def_function.function(
          input_signature=[tensor.TensorSpec(None, dtypes.string)]
      )
      def f(v):
          return ragged_string_ops.ngrams(v, 2)
  
      with self.assertRaisesRegex(
          ValueError, "Rank of data must be known."
      ):
          f([b"foo", b"bar"])
  
imports: from absl.testing import parameterized
  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 tensor
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops.ragged import ragged_factory_ops
  from tensorflow.python.ops.ragged import ragged_string_ops
  from tensorflow.python.platform import test
label_desc: Use image node_id 24 for calling the StringNgramsTest obj's underlying member method code with example usage: obj.test_unknown_rank_error() and returns: ragged_string_ops