code: def _testCpuMatmul(
      self,
      x,
      y,
      tr_a=False,
      tr_b=False,
      sp_a=True,
      sp_b=False,
      x_dtype=dtypes.float32,
      y_dtype=dtypes.float32,
  ):
      with self.cached_session(use_gpu=False):
          tf_x = math_ops.cast(x, x_dtype)
          tf_y = math_ops.cast(y, y_dtype)
          tf_ans = math_ops.matmul(
              tf_x,
              tf_y,
              transpose_a=tr_a,
              transpose_b=tr_b,
              a_is_sparse=sp_a,
              b_is_sparse=sp_b,
          )
          out = self.evaluate(tf_ans)
          np_x = math_ops.cast(tf_x, dtypes.float32).eval()
          np_y = math_ops.cast(tf_y, dtypes.float32).eval()
  
      if tr_a:
          np_x = np.transpose(np_x)
      if tr_b:
          np_y = np.transpose(np_y)
  
      np_ans = np.matrix(np_x) * np.matrix(np_y)
      self.assertShapeEqual(np_ans, tf_ans)
      self.assertAllCloseAccordingToType(
          np_ans, out, rtol=1e-4, atol=1e-4
      )
  
file_path: tensorflow-upstream/tensorflow/python/kernel_tests/sparse_ops/sparse_matmul_op_test.py
imports: import numpy
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import gradient_checker
  from tensorflow.python.ops import math_ops
  from tensorflow.python.platform import test
label_desc: Use image node_id 1 for calling the SparseMatMulTest obj's underlying member method code with example usage: obj._testCpuMatmul(x, y, tr_a, tr_b, sp_a, sp_b, x_dtype, y_dtype) without return types