code: def backward(self, indexes, grad_outputs):
      inputs = self.get_retained_inputs()
  
      e1 = _as_mat(inputs[0])
      e2 = _as_mat(inputs[1])
      W, gy = inputs[2], inputs[-1]
  
      gge1 = _as_mat(grad_outputs[0])
      gge2 = _as_mat(grad_outputs[1])
      ggW = grad_outputs[2]
  
      dge1_de2 = _ij_il_jkl_to_ik(gge1, gy, W)
      dge1_dW = _ij_ik_il_to_jkl(gge1, e2, gy)
      dge1_dgy = _ij_ik_jkl_to_il(gge1, e2, W)
  
      dge2_de1 = _ik_il_jkl_to_ij(gge2, gy, W)
      dge2_dW = _ij_ik_il_to_jkl(e1, gge2, gy)
      dge2_dgy = _ij_ik_jkl_to_il(e1, gge2, W)
  
      dgW_de1 = _ik_il_jkl_to_ij(e2, gy, ggW)
      dgW_de2 = _ij_il_jkl_to_ik(e1, gy, ggW)
      dgW_dgy = _ij_ik_jkl_to_il(e1, e2, ggW)
  
      ge1 = dgW_de1 + dge2_de1
      ge2 = dgW_de2 + dge1_de2
      gW = dge1_dW + dge2_dW
      ggy = dgW_dgy + dge1_dgy + dge2_dgy
  
      if len(inputs) == 6:
          V1, V2 = inputs[3], inputs[4]
          ggV1, ggV2, ggb = grad_outputs[3:]
  
          gV1 = chainer.functions.matmul(gge1, gy, transa=True)
          gV2 = chainer.functions.matmul(gge2, gy, transa=True)
  
          ge1 += chainer.functions.matmul(gy, ggV1, transb=True)
          ge2 += chainer.functions.matmul(gy, ggV2, transb=True)
          ggy += chainer.functions.matmul(gge1, V1)
          ggy += chainer.functions.matmul(gge2, V2)
          ggy += chainer.functions.matmul(e1, ggV1)
          ggy += chainer.functions.matmul(e2, ggV2)
          ggy += chainer.functions.broadcast_to(ggb, ggy.shape)
  
      ge1 = ge1.reshape(inputs[0].shape)
      ge2 = ge2.reshape(inputs[1].shape)
  
      if len(inputs) == 6:
          return ge1, ge2, gW, gV1, gV2, ggy
      return ge1, ge2, gW, ggy
  
imports: import numpy
  import chainer
  from chainer import backend
  from chainer import function_node
  from chainer.utils import type_check
label_desc: Use image node_id 2 for calling the BilinearFunctionGrad obj's underlying member method code with example usage: obj.backward(indexes, grad_outputs) and returns: ge1,  ge2,  gW,  ggy, ge1,  ge2,  gW,  gV1,  gV2,  ggy