code: def testRowLengths(
      self,
      rt_input,
      expected,
      axis=1,
      ragged_rank=None,
      expected_ragged_rank=None,
  ):
      rt = ragged_factory_ops.constant(
          rt_input, ragged_rank=ragged_rank
      )
      lengths = rt.row_lengths(axis)
      self.assertAllEqual(lengths, expected)
      if expected_ragged_rank is not None:
          if isinstance(lengths, ragged_tensor.RaggedTensor):
              self.assertEqual(
                  lengths.ragged_rank, expected_ragged_rank
              )
          else:
              self.assertEqual(0, expected_ragged_rank)
  
file_path: tensorflow-upstream/tensorflow/python/ops/ragged/ragged_row_lengths_op_test.py
imports: from absl.testing import parameterized
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops.ragged import ragged_factory_ops
  from tensorflow.python.ops.ragged import ragged_tensor
  from tensorflow.python.platform import googletest
label_desc: Use image node_id 1 for calling the RaggedRowLengthsOp obj's underlying member method code with example usage: obj.testRowLengths(rt_input, expected, axis, ragged_rank, expected_ragged_rank) without return types