code: def testShapeInference(self):
      x = np.random.rand(10, 10)
      x[np.abs(x) < 0.5] = 0  # Make it sparse
      y = np.random.randn(10, 20)
      x_indices = np.vstack(np.where(x)).astype(np.int64).T
      x_values = x[np.where(x)]
      x_shape = x.shape
  
      with ops.Graph().as_default():
          x_st = sparse_tensor.SparseTensor(
              x_indices, x_values, x_shape
          )
          result = sparse_ops.sparse_tensor_dense_matmul(x_st, y)
          self.assertEqual(result.get_shape(), (10, 20))
  
          x_shape_unknown = array_ops.placeholder(
              dtype=dtypes.int64, shape=None
          )
          x_st_shape_unknown = sparse_tensor.SparseTensor(
              x_indices, x_values, x_shape_unknown
          )
          result_left_shape_unknown = (
              sparse_ops.sparse_tensor_dense_matmul(
                  x_st_shape_unknown, y
              )
          )
          self.assertEqual(
              result_left_shape_unknown.get_shape().as_list(),
              [None, 20],
          )
  
          x_shape_inconsistent = [10, 15]
          x_st_shape_inconsistent = sparse_tensor.SparseTensor(
              x_indices, x_values, x_shape_inconsistent
          )
          with self.assertRaisesRegex(
              ValueError, "Dimensions must be equal"
          ):
              sparse_ops.sparse_tensor_dense_matmul(
                  x_st_shape_inconsistent, y
              )
  
imports: import sys
  import time
  from absl import app
  import numpy
  from tensorflow.core.protobuf import config_pb2
  from tensorflow.python.client import session
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import sparse_tensor
  from tensorflow.python.framework import tensor_shape
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import sparse_ops
  from tensorflow.python.ops import while_loop
  from tensorflow.python.platform import test
label_desc: Use image node_id 4 for calling the SparseTensorDenseMatMulTest obj's underlying member method code with example usage: obj.testShapeInference() without return types