code: def backward(self, indexes, grad_outputs):
      a, b = self.get_retained_inputs()
      (gy,) = grad_outputs
      is_a_vector = a.ndim == 1
      is_b_vector = b.ndim == 1
  
      ret = []
      if 0 in indexes:
          if is_b_vector:
              u, v = chainer.functions.cast(gy, b.dtype), b
              if not is_a_vector:
                  if self.transa:
                      u, v = v, u
                  u = chainer.functions.expand_dims(u, -1)
                  v = (
                      chainer.functions.expand_dims(v, -2)
                      if v.ndim > 1
                      else v
                  )
              ga = chainer.functions.cast(u * v, a.dtype)
          elif is_a_vector:
              bt = chainer.functions.rollaxis(
                  b, -1 if self.transb else -2
              )
              ga = chainer.functions.tensordot(bt, gy, axes=gy.ndim)
              ga = chainer.functions.cast(ga, a.dtype)
          else:
              (ga,) = MatMul(
                  self.transc, not self.transb, self.transa, a.dtype
              ).apply((gy, b))
              ga = chainer.functions.sum_to(ga, a.shape)
          ret.append(ga)
  
      if 1 in indexes:
          if is_a_vector:
              u, v = a, chainer.functions.cast(gy, a.dtype)
              if not is_b_vector:
                  if self.transb:
                      u, v = v, u
                  u = chainer.functions.expand_dims(u, -1)
                  v = (
                      chainer.functions.expand_dims(v, -2)
                      if v.ndim > 1
                      else v
                  )
              gb = chainer.functions.cast(u * v, b.dtype)
          elif is_b_vector:
              at = chainer.functions.rollaxis(
                  a, -2 if self.transa else -1
              )
              gb = chainer.functions.tensordot(at, gy, axes=gy.ndim)
              gb = chainer.functions.cast(gb, b.dtype)
          else:
              (gb,) = MatMul(
                  not self.transa, self.transc, self.transb, b.dtype
              ).apply((a, gy))
              gb = chainer.functions.sum_to(gb, b.shape)
          ret.append(gb)
  
      return ret
  
imports: import warnings
  import numpy
  from chainer import backend
  from chainer.backends import cuda
  from chainer import function_node
  import chainer.functions
  from chainer import utils
  from chainer.utils import type_check
  import chainerx
label_desc: Use image node_id 5 for calling the MatMul obj's underlying member method code with example usage: obj.backward(indexes, grad_outputs) and returns: ret