code: def test_reshape_first_ndims_sparse_tensor(self):
      # Batch size = 2, list size = 3, embedding size = 3.
      # Tensor:
      # [[[1, 0, 0], [0, 2, 0], [0, 0, 3]], [[4, 0, 0], [0, 5, 0], [0, 0, 6]]].
      # Reshaped :
      # [[[1, 0, 0], [0, 2, 0], [0, 0, 3], [4, 0, 0], [0, 5, 0], [0, 0, 6]]].
      sparse_tensor = tf.SparseTensor(
          indices=[
              [0, 0, 0],
              [0, 1, 1],
              [0, 2, 2],
              [1, 0, 0],
              [1, 1, 1],
              [1, 2, 2],
          ],
          values=[1, 2, 3, 4, 5, 6],
          dense_shape=[2, 3, 3],
      )
      target = tf.SparseTensor(
          indices=[[0, 0], [1, 1], [2, 2], [3, 0], [4, 1], [5, 2]],
          values=[1, 2, 3, 4, 5, 6],
          dense_shape=[6, 3],
      )
      reshaped = utils.reshape_first_ndims(sparse_tensor, 2, [6])
      self.assertAllEqual(reshaped.indices, target.indices)
      self.assertAllEqual(reshaped.values, target.values)
      self.assertAllEqual(reshaped.dense_shape, target.dense_shape)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import math
  import tensorflow
  from tensorflow_ranking.python import utils
label_desc: Use image node_id 12 for calling the UtilsTest obj's underlying member method code with example usage: obj.test_reshape_first_ndims_sparse_tensor() without return types