code: def test_tf(
      self,
      use_cpu_only,
      backend,
      transpose_a,
      transpose_b,
      a_is_sparse,
      b_is_sparse,
  ):
      rank = 2
      shape = list(np.random.randint(low=3, high=100, size=1)) * rank
      with tf.Graph().as_default() as graph:
          x = tf.placeholder(tf.float32, shape=shape)
          y = tf.placeholder(tf.float32, shape=shape)
          ref = tf.sparse_matmul(
              x,
              y,
              transpose_a=transpose_a,
              transpose_b=transpose_b,
              a_is_sparse=a_is_sparse,
              b_is_sparse=b_is_sparse,
          )
          spec, _, _, _ = tf_graph_to_proto(
              graph,
              {
                  x: random_gen(shape, rand_min=-100, rand_max=100),
                  y: random_gen(shape, rand_min=-100, rand_max=100),
              },
              ref,
              backend=backend,
          )
          layers = spec.neuralNetwork.layers
          assert (
              layers[-1].custom is not None
          ), "Expecting a custom layer"
          assert (
              "SparseMatMul" == layers[-1].custom.className
          ), "Custom Layer class name mis-match"
          assert (
              transpose_a
              == layers[-1].custom.parameters["transpose_x"].boolValue
          ), "Incorrect parameter value k"
          assert (
              transpose_b
              == layers[-1].custom.parameters["transpose_y"].boolValue
          ), "Incorrect parameter value k"
          assert (
              a_is_sparse
              == layers[-1].custom.parameters["x_is_sparse"].boolValue
          ), "Incorrect parameter value k"
          assert (
              b_is_sparse
              == layers[-1].custom.parameters["y_is_sparse"].boolValue
          ), "Incorrect parameter value k"
  
file_path: turicreate/src/external/coremltools_wrap/coremltools/coremltools/converters/mil/frontend/tensorflow/test/test_custom_ops.py
imports: from coremltools.converters.mil import testing_reqs
  from coremltools.converters.mil.testing_reqs import *
  from coremltools.converters.mil.frontend.tensorflow.test.testing_utils import make_tf_graph, tf_graph_to_proto, run_compare_tf
  from coremltools.converters.mil.frontend.tensorflow.tf_op_registry import register_tf_op
  from coremltools.converters.mil.frontend.tensorflow.tf_op_registry import _TF_OPS_REGISTRY
  from coremltools.converters.mil.mil.ops.defs._op_reqs import *
  from coremltools.converters.mil.mil import Builder
  from coremltools.converters.mil.mil.types.symbolic import is_symbolic
label_desc: Use image node_id 2 for calling the TestCustomMatMul obj's underlying member method code with example usage: obj.test_tf(use_cpu_only, backend, transpose_a, transpose_b, a_is_sparse, b_is_sparse) without return types