- backward_api : matmul_grad 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) output : Tensor(x_grad), Tensor(y_grad) infer_meta : func : GeneralBinaryGradInferMeta param : [x, y] kernel : func : matmul_grad - 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 - backward_api : scale_grad 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) output : Tensor(x_grad) invoke : scale(out_grad, scale, bias, bias_after_scale) - backward_api : add_grad forward : add (Tensor x, Tensor y) -> Tensor(out) args : (Tensor x, Tensor y, Tensor out_grad) output : Tensor(x_grad), Tensor(y_grad) infer_meta : func : GeneralBinaryGradInferMeta param : [x, y] kernel : func : add_grad - backward_api : digamma_grad forward : digamma (Tensor x) -> Tensor(out) args : (Tensor x, Tensor out_grad) output : Tensor(x_grad) infer_meta : func : UnchangedInferMeta param : [x] kernel : func : digamma_grad - backward_api : abs_grad forward : abs (Tensor x) -> Tensor(out) args : (Tensor x, Tensor out_grad) output : Tensor(x_grad) infer_meta : func : UnchangedInferMeta param : [x] kernel : func : abs_grad - backward_api : trunc_grad forward : trunc (Tensor x) -> Tensor(out) args : (Tensor out_grad) output : Tensor(x_grad) infer_meta : func : UnchangedInferMeta param : [out_grad] kernel : func : trunc_grad # - backward_api : norm_grad # forward : norm (Tensor x, int axis, float epsilon, bool is_test) -> Tensor(out), Tensor(norm) # args : (Tensor out_grad, Tensor x, Tensor norm, int axis, float epsilon, bool is_test) # output : Tensor(x_grad) # infer_meta : # func : UnchangedInferMeta # param : [x] # kernel : # func : norm_grad - backward_api : diagonal_grad forward : diagonal (Tensor x, int offset, int axis1, int axis2) -> Tensor(out) args : (Tensor x, Tensor out_grad, int offset = 0, int axis1 = 0, int axis2 = 1) output : Tensor(x_grad) infer_meta : func : UnchangedInferMeta param : [x] kernel : func : diagonal_grad # - backward_api : split_grad # forward : split (Tensor x, ScalarArray num_or_sections, Scalar axis) -> Tensor[](out) # args : (Tensor[] out_grad, Scalar axis) # output : Tensor(x_grad) # invoke : concat( out_grad, axis) # TODO(zhangyunfei) The config of double grad and triple grad will be supported in the future. # - backward_api : matmul_triple_grad # 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) # infer_meta : # func : MatmulTripleGradInferMeta # kernel : # func : matmul_triple_grad # - backward_api : gumbel_softmax_grad # forward : gumbel_softmax (Tensor x, float temperature, bool hard, int axis) -> Tensor(out) # args : (Tensor out, Tensor out_grad, int axis) # output : Tensor(x_grad) # infer_meta : # func : GumbelSoftmaxGradInferMeta # param : [out, out_grad, axis] # kernel : # func : gumbel_softmax_grad - backward_api : transpose_grad forward : transpose (Tensor x, int[] axis) -> Tensor(out) args : (Tensor out_grad, int[] axis) output : Tensor(x_grad) infer_meta : func : TransposeGradInferMeta param : [out_grad, axis] kernel : func : transpose_grad # - backward_api : lerp_grad # forward : transpose (Tensor x, Tensor y, Tensor weight) -> Tensor(out) # args : (Tensor x, Tensor y, Tensor weight, Tensor out, Tensor out_grad) # output : Tensor(x_grad), Tensor(y_grad) # infer_meta : # func : GeneralBinaryGradInferMeta # param : [x, y] # kernel : # func : lerp_grad - backward_api : scatter_grad forward : scatter (Tensor x, Tensor index, Tensor updates, bool overwrite) -> Tensor(out) args : (Tensor index, Tensor updates, Tensor out_grad, bool overwrite) output : Tensor(x_grad), Tensor(updates_grad) infer_meta : func : ScatterGradInferMeta param : [index, updates, out_grad, overwrite] kernel : func : scatter_grad - backward_api : scatter_nd_add_grad forward : scatter (Tensor x, Tensor index, Tensor updates) -> Tensor(out) args : (Tensor index, Tensor updates, Tensor out_grad) output : Tensor(x_grad), Tensor(updates_grad) infer_meta : func : ScatterNdAddGradInferMeta param : [index, updates, out_grad] kernel : func : scatter_nd_grad - backward_api : addmm_grad forward : scatter (Tensor input, Tensor x, Tensor y, float alpha, float beta) -> Tensor(out) args : (Tensor input, Tensor x, Tensor y, Tensor out_grad, float alpha, float beta) output : Tensor(input_grad), Tensor(x_grad), Tensor(y_grad) infer_meta : func : GeneralTernaryGradInferMeta param : [input, x, y] kernel : func : addmm_grad - backward_api : where_grad forward : where (Tensor condition, Tensor x, Tensor y) -> Tensor(out) args : (Tensor condition, Tensor x, Tensor y, Tensor out_grad) output : Tensor(x_grad), Tensor(y_grad) infer_meta : func : GeneralBinaryGradInferMeta param : [x, y] kernel : func : where_grad # - backward_api : huber_loss_grad # forward : huber_loss (Tensor input, Tensor label, float delta) -> Tensor(out), Tensor(residual) # args : (Tensor residual, Tensor out_grad, float delta) # output : Tensor(input_grad), Tensor(label_grad) # infer_meta : # func : GeneralBinaryGradInferMeta # param : [x, y] # kernel : # func : where_grad # - backward_api : triangular_solve_grad # forward : triangular_solve (Tensor x, Tensor y, bool upper, bool tranpose, bool unitriangular) -> Tensor(out) # args : (Tensor x, Tensor y, Tensor out, Tensor out_grad, bool upper, bool tranpose, bool unitriangular) # output : Tensor(x_grad), Tensor(y_grad) # infer_meta : # func : GeneralBinaryGradInferMeta # param : [x, y] # kernel : # func : triangular_solve_grad - backward_api : index_sample_grad forward : index_sample (Tensor x, Tensor index) -> Tensor(out) args : (Tensor x, Tensor index, Tensor out_grad) output : Tensor(x_grad) infer_meta : func : UnchangedInferMeta param : [x] kernel : func : index_sample_grad - backward_api : cross_grad forward : cross (Tensor x, Tensor y, int axis = 9) -> Tensor(out) args : (Tensor x, Tensor y, Tensor out_grad, int axis) output : Tensor(x_grad), Tensor(y_grad) infer_meta : func : GeneralBinaryGradInferMeta param : [x, y] kernel : func : cross_grad - backward_api : atan2_grad forward : cross (Tensor x, Tensor y) -> Tensor(out) args : (Tensor x, Tensor y, Tensor out_grad) output : Tensor(x_grad), Tensor(y_grad) infer_meta : func : GeneralBinaryGradInferMeta param : [x, y] kernel : func : atan2_grad - backward_api : bce_loss_grad forward : bce_loss (Tensor input, Tensor label) -> Tensor(out) args : (Tensor input, Tensor label, Tensor out_grad) output : Tensor(input_grad) infer_meta : func : UnchangedInferMeta param : [input] kernel : func : bce_loss_grad # - backward_api : dist_grad # forward : dist (Tensor x, Tensor y, float p) -> Tensor(out) # args : (Tensor x, Tensor y, Tensor out, Tensor out_grad, float p) # output : Tensor(x_grad), Tensor(y_grad) # infer_meta : # func : GeneralBinaryGradInferMeta # param : [x, y] # kernel : # func : dist_grad - backward_api : gather_nd_grad forward : gather_nd (Tensor x, Tensor index) -> Tensor(out) args : (Tensor x, Tensor index, Tensor out_grad) output : Tensor(x_grad) infer_meta : func : UnchangedInferMeta param : [x] kernel : func : gather_nd_grad - backward_api : mv_grad forward : mv (Tensor x, Tensor vec) -> Tensor(out) args : (Tensor x, Tensor vec, Tensor out_grad) output : Tensor(x_grad), Tensor(vec_grad) infer_meta : func : GeneralBinaryGradInferMeta param : [x, vec] kernel : func : mv_grad