backward.yaml 1.8 KB
Newer Older
1
- backward_api : matmul_grad
Z
zyfncg 已提交
2 3
  forward : matmul (Tensor x, Tensor y, bool transpose_x=false, bool transpose_y=false) -> Tensor(out)
  args : (Tensor x, Tensor y, Tensor out_grad, bool transpose_x=false, bool transpose_y=false)
4 5
  output : Tensor(x_grad), Tensor(y_grad)
  infer_meta :
6 7
    func : GeneralBinaryGradInferMeta
    param : [x, y]
8 9 10 11
  kernel :
    func : matmul_grad

- backward_api : scale_grad
Z
zyfncg 已提交
12 13
  forward : scale (Tensor x, Scalar scale, float bias, bool bias_after_scale) -> Tensor(out)
  args : (Tensor out_grad, Scalar scale, float bias=0.0, bool bias_after_scale=true)
14 15 16 17 18 19
  output : Tensor(x_grad)
  invoke : scale(out_grad, scale, bias, bias_after_scale)

# TODO(zhangyunfei) The config of double grad and triple grad will be supported in the future.
#
# - backward_api : matmul_double_grad
Z
zyfncg 已提交
20 21 22
#   forward : matmul_grad (Tensor x, Tensor y, Tensor out_grad, bool transpose_x, bool transpose_y) -> Tensor(dx), Tensor>(dy)
#   args : (Tensor x, Tensor y, Tensor out_grad, Tensor dx_grad, Tensor dy_grad, bool transpose_x, bool transpose_y)
#   output : Tensor(d2x), Tensor(d2y), Tensor(dout_grad)
23 24 25 26 27 28
#   infer_meta :
#     func : MatmulDoubleGradInferMeta
#   kernel :
#     func : matmul_double_grad

# - backward_api : matmul_triple_grad
Z
zyfncg 已提交
29 30 31
#   forward : matmul_double_grad (Tensor x, Tensor y, Tensor out_grad, Tensor dx_grad, Tensor dy_grad, bool transpose_x, bool transpose_y) -> Tensor(d2x), Tensor(d2y), Tensor(dout_grad)
#   args : (Tensor x, Tensor y, Tensor out_grad, Tensor dx_grad, Tensor dy_grad, Tensor d2x_grad, Tensor d2y_grad, Tensor dout_grad_grad, bool transpose_x, bool transpose_y)
#   output : Tensor(d3x), Tensor(d3y), Tensor(d2out_grad), Tensor(ddx_grad), Tensor(ddy_grad)
32 33 34 35
#   infer_meta :
#     func : MatmulTripleGradInferMeta
#   kernel :
#     func : matmul_triple_grad