code: def _coo_matmul_gradsp(
      a, b, c_row, c_col, c_shape, transa, transb, transc, dtype
  ):
      if dtype is None:
          dtype = numpy.result_type(a.dtype, b.dtype)
  
      if transa:
          A = a.swapaxes(-1, -2)
      else:
          A = a
      if transb:
          B = b.swapaxes(-1, -2)
      else:
          B = b
      if transc:
          C_row = c_col
          C_col = c_row
      else:
          C_row = c_row
          C_col = c_col
  
      xp = backend.get_array_module(A, B)
      if xp is numpy:
          return _coo_matmul_gradsp_cpu(A, B, C_row, C_col, dtype)
      else:
          return _coo_matmul_gradsp_gpu(A, B, C_row, C_col, dtype)
  
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 5 for calling a global function with example usage: _coo_matmul_gradsp(a, b, c_row, c_col, c_shape, transa, transb, transc, dtype) and returns: _coo_matmul_gradsp_cpu, _coo_matmul_gradsp_gpu