code: def testShape(self):
      rt = ragged_factory_ops.constant(
          [[1, 2], [3, 4, 5], [6], [], [7]]
      )
      st = rt.to_sparse()
      self.assertEqual(st.indices.shape.as_list(), [7, 2])
      self.assertEqual(st.values.shape.as_list(), [7])
      self.assertEqual(st.dense_shape.shape.as_list(), [2])
  
      rt = ragged_factory_ops.constant(
          [[[1, 2]], [], [[3, 4]], []], ragged_rank=1
      )
      st = rt.to_sparse()
      self.assertEqual(st.indices.shape.as_list(), [4, 3])
      self.assertEqual(st.values.shape.as_list(), [4])
      self.assertEqual(st.dense_shape.shape.as_list(), [3])
  
      rt = ragged_factory_ops.constant(
          [[[1], [2, 3, 4, 5, 6, 7]], [[]]]
      )
      st = rt.to_sparse()
      self.assertEqual(st.indices.shape.as_list(), [7, 3])
      self.assertEqual(st.values.shape.as_list(), [7])
      self.assertEqual(st.dense_shape.shape.as_list(), [3])
  
imports: 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 import gradients_impl
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops.ragged import ragged_factory_ops
  from tensorflow.python.ops.ragged import ragged_functional_ops
  from tensorflow.python.ops.ragged import ragged_tensor
  from tensorflow.python.platform import googletest
label_desc: Use image node_id 6 for calling the RaggedTensorToSparseOpTest obj's underlying member method code with example usage: obj.testShape() without return types