code: def affine_backward(
      grad_inputs,
      inputs,
      input_shapes,
      outputs,
      output_shapes,
      base_axis=1,
  ):
      """
      Args:
        grad_inputs (list of :obj:`nnabla.Variable`): Propagated grads to this backward function.
        inputs (list of :obj:`nnabla.Variable` and None): Input Variables of the forward function
            if this backward function depends on it. Otherwise, None is set instead.
        input_shapes (list of tuple of :obj:`int`): Input shapes of the forward function.
            The shapes of the inputs in which None is set can be passed.
        outputs (list of :obj:`nnabla.Variable` and None): Output Variables of the forward function
            if this backward function depends on it. Otherwise, None is set instead.
        output_shapes (list of tuple of :obj:`int`): Output shapes of the forward function.
            The shapes of the outputs in which None is set can be passed.
        kwargs (dict of arguments): Dictionary of the corresponding function arguments.
  
      Return:
        list of Variable: Return the gradients wrt inputs of the corresponding function.
      """
      dy = grad_inputs[0]
      x0 = inputs[0]
      w0 = inputs[1]
  
      base_axis += inputs[0].ndim * (base_axis < 0)
  
      ctx = nn.get_current_context()
      dfx = AffineDataGrad(ctx, base_axis)
      dfw = AffineFilterGrad(ctx, base_axis)
      dfx.xshape = x0.shape
      dfw.wshape = w0.shape
  
      dx0 = dfx(dy, w0)
      dw0 = dfw(dy, x0)
  
      if len(inputs) == 3:
          axes = [i for i in range(0, base_axis)]
          db0 = F.sum(dy, axes, keepdims=False)
          return dx0, dw0, db0
      else:
          return dx0, dw0
  
file_path: nnabla/python/src/nnabla/backward_function/affine.py
imports: import nnabla
  import nnabla.function
  import nnabla.functions
  from .backward_function import LinearDataGrad, LinearFilterGrad
label_desc: Use image node_id 1 for calling a global function with example usage: affine_backward(grad_inputs, inputs, input_shapes, outputs, output_shapes, base_axis) and returns: dx0,  dw0,  db0, dx0,  dw0