code: def testDenseSparseTensorMatMul(self):
      np.random.seed(42)
      dense_numpy_array = np.random.rand(3, 3)
      independent_dense_tf = constant_op.constant(
          dense_numpy_array, dtype="float32"
      )
  
      sp = sparse_tensor.SparseTensor(
          indices=[[0, 0], [1, 2]],
          values=[4.0, 8.0],
          dense_shape=[3, 3],
      )
      dense_of_sparse = sparse_ops.sparse_to_dense(
          sp.indices, sp.shape, sp.values
      )
  
      result = sparse_ops.sparse_tensor_dense_matmul(
          independent_dense_tf, sp, adjoint_a=False, adjoint_b=False
      )
      expected = math_ops.matmul(independent_dense_tf, dense_of_sparse)
      self.assertAllEqual(expected, result)
  
      result = sparse_ops.sparse_tensor_dense_matmul(
          independent_dense_tf, sp, adjoint_a=False, adjoint_b=True
      )
      expected = math_ops.matmul(
          independent_dense_tf, array_ops.transpose(dense_of_sparse)
      )
      self.assertAllEqual(expected, result)
  
      result = sparse_ops.sparse_tensor_dense_matmul(
          independent_dense_tf, sp, adjoint_a=True, adjoint_b=False
      )
      expected = math_ops.matmul(
          array_ops.transpose(independent_dense_tf), dense_of_sparse
      )
      self.assertAllEqual(expected, result)
  
      result = sparse_ops.sparse_tensor_dense_matmul(
          independent_dense_tf, sp, adjoint_a=True, adjoint_b=True
      )
      expected = math_ops.matmul(
          array_ops.transpose(independent_dense_tf),
          array_ops.transpose(dense_of_sparse),
      )
      self.assertAllEqual(expected, result)
  
imports: from absl.testing import parameterized
  import numpy
  from tensorflow.python.eager import context
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import sparse_tensor
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_grad
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import gen_sparse_ops
  from tensorflow.python.ops import gradient_checker_v2
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import sparse_grad
  from tensorflow.python.ops import sparse_ops
  from tensorflow.python.platform import googletest
label_desc: Use image node_id 8 for calling the SparseOpsTest obj's underlying member method code with example usage: obj.testDenseSparseTensorMatMul() without return types