code: def sparse_matmul(a, b, transa=False, transb=False):
      """Computes the batched multiplication of sparse and dense matrix.
  
      The following use cases are supported:
  
          1. C (dense) = A (sparse) * B (dense)
          2. C (dense) = A (dense) * B (sparse)
  
      Args:
          a (~chainer.Variable or ~chainer.utils.CooMatrix): The left operand of
              matrix multiplication.
          b (~chainer.Variable or ~chainer.utils.CooMatrix): The right operand of
              matrix multiplication.
          transa (bool): If ``True``, each matrix in ``a`` will be transposed.
          transb (bool): If ``True``, each matrix in ``b`` will be transposed.
  
      Returns:
          ~chainer.Variable: Result of batched mat-mul.
  
      .. seealso::
          See :func:`~chainer.utils.to_coo` for how to construct a COO matrix
          from an array.
  
      .. note::
          Performance of this function on GPU can be improved by using the
          ``order`` argument of :class:`~chainer.utils.CooMatrix` when the sparse
          matrix is created.
  
      """
      if isinstance(a, utils.CooMatrix) and isinstance(
          b, (chainer.Variable, numpy.ndarray, cuda.ndarray)
      ):
          return CooMatMul(
              a.row,
              a.col,
              a.shape,
              a.order,
              transa=transa,
              transb=transb,
              transc=False,
          ).apply((a.data, b))[0]
      elif isinstance(
          a, (chainer.Variable, numpy.ndarray, cuda.ndarray)
      ) and isinstance(b, utils.CooMatrix):
          return CooMatMul(
              b.row,
              b.col,
              b.shape,
              b.order,
              transa=not transb,
              transb=not transa,
              transc=True,
          ).apply((b.data, a))[0]
      else:
          msg = "This combination of type of inputs is not supported.\n"
          msg += "    a: {}\n".format(type(a))
          msg += "    b: {}\n".format(type(b))
          raise ValueError(msg)
  
imports: import numpy
  import chainer
  from chainer import backend
  from chainer.backends import cuda
  from chainer import function_node
  from chainer import utils
  from chainer.utils import type_check
label_desc: Use image node_id 9 for calling a global function with example usage: sparse_matmul(a, b, transa, transb) and returns: CooMatMul, CooMatMul