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
  kernel :
    func : matmul_grad

11 12 13 14 15 16 17 18 19 20 21
- backward_api : matmul_double_grad
  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)
  infer_meta :
    func : GeneralTernaryGradInferMeta
    param : [x, y, out_grad]
  kernel :
    func : matmul_double_grad
  optional : dx_grad, dy_grad

22
- backward_api : scale_grad
Z
zyfncg 已提交
23 24
  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)
25 26 27 28 29 30
  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_triple_grad
Z
zyfncg 已提交
31 32 33
#   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)
34 35 36 37
#   infer_meta :
#     func : MatmulTripleGradInferMeta
#   kernel :
#     func : matmul_triple_grad