legacy_backward.yaml 74.9 KB
Newer Older
1
- backward_op : abs_double_grad
Z
zyfncg 已提交
2 3 4 5 6 7 8 9 10
  forward : abs_grad (Tensor x, Tensor grad_out) -> Tensor(grad_x)
  args : (Tensor x, Tensor grad_x_grad)
  output : Tensor(grad_out_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : abs_double_grad

11
- backward_op : abs_grad
Z
zyfncg 已提交
12 13 14 15 16 17 18 19 20 21
  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 : abs_double_grad

22
- backward_op : add_double_grad
Z
zyfncg 已提交
23 24 25 26 27 28 29 30 31 32 33 34
  forward : add_grad (Tensor x, Tensor y, Tensor grad_out, int axis = -1) -> Tensor(grad_x), Tensor(grad_y)
  args : (Tensor y, Tensor grad_out, Tensor grad_x_grad, Tensor grad_y_grad, int axis = -1)
  output : Tensor(grad_out_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [grad_out]
  kernel :
    func : add_double_grad
  optional : grad_x_grad, grad_y_grad
  backward : add_triple_grad
  inplace : (grad_x_grad -> grad_out_grad)

35
- backward_op : add_grad
Z
zyfncg 已提交
36 37 38 39 40 41 42 43 44 45 46 47
  forward : add (Tensor x, Tensor y) -> Tensor(out)
  args : (Tensor x, Tensor y, Tensor out_grad, int axis = -1)
  output : Tensor(x_grad), Tensor(y_grad)
  infer_meta :
    func : GeneralBinaryGradInferMeta
    param : [x, y]
  kernel :
    func : add_grad
  no_need_buffer : x, y
  backward : add_double_grad
  inplace : (out_grad -> x_grad)

48
- backward_op : add_triple_grad
Z
zyfncg 已提交
49 50 51 52 53 54 55 56 57 58
  forward : add_double_grad (Tensor y, Tensor grad_out, Tensor grad_grad_x, Tensor grad_grad_y, int axis = -1) -> Tensor(grad_grad_out)
  args : (Tensor grad_grad_x, Tensor grad_grad_y, Tensor grad_grad_out_grad, int axis = -1)
  output : Tensor(grad_grad_x_grad), Tensor(grad_grad_y_grad)
  infer_meta :
    func : GeneralBinaryGradInferMeta
    param : [grad_grad_x, grad_grad_y]
  kernel :
    func : add_triple_grad
  inplace : (grad_grad_out_grad -> grad_grad_x_grad)

59
- backward_op : addmm_grad
60
  forward : addmm (Tensor input, Tensor x, Tensor y, float beta, float alpha) -> Tensor(out)
Z
zyfncg 已提交
61 62 63 64 65 66 67 68
  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

69
- backward_op : affine_grid_grad
70 71
  forward : affine_grid (Tensor input, IntArray outputShape, bool align_corners=true) -> Tensor(output)
  args : (Tensor input, Tensor output_grad, IntArray outputShape, bool align_corners=true)
72 73 74 75 76 77 78
  output : Tensor(input_grad)
  infer_meta :
    func : AffineGridGradInferMeta
    param : [output_grad, outputShape, align_corners]
  kernel :
    func : affine_grid_grad
    param : [output_grad, outputShape, align_corners]
79
  no_need_buffer : input
80

81
- backward_op : amax_grad
82 83
  forward: amax (Tensor x,  int64_t[] axis={},  bool keepdim=false) -> Tensor(out)
  args : (Tensor x, Tensor out, Tensor out_grad, int64_t[] axis={},  bool keepdim=false, bool reduce_all=false)
84 85 86 87 88 89 90
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param: [x]
  kernel :
    func : amax_grad

91
- backward_op : amin_grad
92 93
  forward: amin (Tensor x,  int64_t[] axis={},  bool keepdim=false) -> Tensor(out)
  args : (Tensor x, Tensor out, Tensor out_grad, int64_t[] axis={},  bool keepdim=false, bool reduce_all=false)
94 95 96 97 98 99 100
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param: [x]
  kernel :
    func : amin_grad

101
- backward_op : assign_grad
Z
zyfncg 已提交
102 103 104
  forward : assign (Tensor x) -> Tensor(out)
  args : (Tensor out_grad)
  output : Tensor(x_grad)
105
  invoke : assign(out_grad)
Z
zyfncg 已提交
106

107
- backward_op : assign_out__grad
Z
zyfncg 已提交
108 109 110 111 112 113 114 115 116
  forward : assign_out_ (Tensor x, Tensor output) -> Tensor(out)
  args : (Tensor out_grad)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
  kernel :
    func : assign
  inplace : (out_grad -> x_grad)

117
- backward_op : batch_norm_double_grad
118 119
  forward : batch_norm_grad (Tensor x, Tensor scale, Tensor bias, Tensor out_mean, Tensor out_variance, Tensor saved_mean, Tensor saved_variance, Tensor reserve_space, Tensor grad_out, float momentum, float epsilon, str data_layout, bool is_test, bool use_global_stats, bool trainable_statistics) -> Tensor(grad_x), Tensor(grad_scale), Tensor(grad_bias)
  args : (Tensor x, Tensor scale, Tensor out_mean, Tensor out_variance, Tensor saved_mean, Tensor saved_variance, Tensor grad_out,  Tensor grad_x_grad, Tensor grad_scale_grad, Tensor grad_bias_grad, float momentum, float epsilon, str data_layout, bool is_test, bool use_global_stats, bool trainable_statistics)
Z
zyfncg 已提交
120 121 122 123 124 125 126 127 128 129
  output : Tensor(x_grad), Tensor(scale_grad), Tensor(grad_out_grad)
  infer_meta :
    func : GeneralTernaryGradInferMeta
    param : [x, scale, x]
  kernel :
    func : batch_norm_grad_grad
    data_type : x
  optional : out_mean, out_variance
  inplace : (grad_out -> grad_out_grad)

130
- backward_op : batch_norm_grad
131 132
  forward : batch_norm (Tensor x, Tensor mean, Tensor variance, Tensor scale, Tensor bias, bool is_test, float momentum, float epsilon, str data_layout, bool use_global_stats, bool trainable_statistics) -> Tensor(out), Tensor(mean_out), Tensor(variance_out), Tensor(saved_mean), Tensor(saved_variance), Tensor(reserve_space)
  args : (Tensor x, Tensor scale, Tensor bias, Tensor mean_out, Tensor variance_out, Tensor saved_mean, Tensor saved_variance, Tensor reserve_space, Tensor out_grad, float momentum, float epsilon, str data_layout, bool is_test, bool use_global_stats, bool trainable_statistics)
Z
zyfncg 已提交
133 134 135 136 137 138 139 140 141 142
  output : Tensor(x_grad), Tensor(scale_grad), Tensor(bias_grad)
  infer_meta :
    func : GeneralTernaryGradInferMeta
    param : [x, scale, bias]
  kernel :
    func : batch_norm_grad
    data_type : out_grad
  optional : mean_out, variance_out, reserve_space
  backward : batch_norm_double_grad

143
- backward_op : bce_loss_grad
Z
zyfncg 已提交
144 145 146 147 148 149 150 151 152 153
  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
  inplace : (out_grad -> input_grad)

154
- backward_op : bicubic_interp_grad
155 156 157 158 159 160 161 162 163 164 165
  forward : bicubic_interp (Tensor x, Tensor out_size, Tensor[] size_tensor, Tensor scale_tensor, str data_layout, int out_d, int out_h, int out_w, float[] scale, str interp_method, bool align_corners, int align_mode) -> Tensor(output)
  args : (Tensor x, Tensor out_size, Tensor[] size_tensor, Tensor scale_tensor, Tensor output_grad, str data_layout, int out_d, int out_h, int out_w, float[] scale, str interp_method, bool align_corners, int align_mode)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param: [x]
  optional: out_size, size_tensor, scale_tensor
  kernel :
    func : bicubic_interp_grad
    data_type : output_grad

166
- backward_op : bilinear_interp_grad
167 168 169 170 171 172 173 174 175 176 177
  forward : bilinear_interp (Tensor x, Tensor out_size, Tensor[] size_tensor, Tensor scale_tensor, str data_layout, int out_d, int out_h, int out_w, float[] scale, str interp_method, bool align_corners, int align_mode) -> Tensor(output)
  args : (Tensor x, Tensor out_size, Tensor[] size_tensor, Tensor scale_tensor, Tensor output_grad, str data_layout, int out_d, int out_h, int out_w, float[] scale, str interp_method, bool align_corners, int align_mode)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param: [x]
  optional: out_size, size_tensor, scale_tensor
  kernel :
    func : bilinear_interp_grad
    data_type : output_grad

178
- backward_op : bilinear_tensor_product_grad
179 180 181 182 183 184 185 186
  forward : bilinear_tensor_product (Tensor x, Tensor y, Tensor weight, Tensor bias) -> Tensor(out)
  args : (Tensor x, Tensor y, Tensor weight, Tensor out_grad)
  output : Tensor(x_grad), Tensor(y_grad), Tensor(weight_grad), Tensor(bias_grad)
  infer_meta :
    func : BilinearTensorProductGradInferMeta
  kernel :
    func : bilinear_tensor_product_grad

187
- backward_op : broadcast_tensors_grad
188 189 190
  forward : broadcast_tensors (Tensor[] input) -> Tensor[](out)
  args : (Tensor[] input, Tensor[] out_grad)
  output : Tensor[](input_grad)
191 192
  infer_meta :
    func : UnchangedMultiInferMeta
193
    param : [input]
194 195 196
  kernel :
    func : broadcast_tensors_grad
    param : [out_grad]
197
  no_need_buffer : input
198

199
- backward_op : cast_grad
200
  forward : cast (Tensor x, DataType dtype) -> Tensor(out)
Z
zyfncg 已提交
201 202
  args : (Tensor x, Tensor out_grad)
  output : Tensor(x_grad)
203
  invoke : cast (out_grad, x.dtype())
Z
zyfncg 已提交
204 205
  no_need_buffer : x

206
- backward_op : clip_double_grad
Z
zyfncg 已提交
207 208 209 210 211 212 213 214 215
  forward : clip_grad (Tensor x, Tensor grad_out, Scalar min = 0., Scalar max = 0.) -> Tensor(grad_x)
  args : (Tensor x, Tensor grad_x_grad, Scalar min = 0., Scalar max = 0.)
  output : Tensor(grad_out_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : clip_grad

216
- backward_op : clip_grad
Z
zyfncg 已提交
217 218 219 220 221 222 223 224 225 226 227
  forward : clip (Tensor x, Scalar min, Scalar max) -> Tensor(out)
  args : (Tensor x, Tensor out_grad, Scalar min = 0., Scalar max = 0.)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : clip_grad
  backward : clip_double_grad
  inplace : (out_grad -> x_grad)

228
- backward_op : complex_grad
229 230 231
  forward : complex (Tensor real, Tensor imag) -> Tensor(out)
  args : (Tensor real, Tensor imag, Tensor out_grad)
  output : Tensor(real_grad), Tensor(imag_grad)
232 233 234 235
  infer_meta :
    func : ComplexGradInferMeta
  kernel :
    func : complex_grad
236
    data_type : real
237

238
- backward_op : concat_double_grad
Z
zyfncg 已提交
239 240 241
  forward : concat_grad (Tensor[] x, Tensor grad_out, Scalar axis) -> Tensor[](grad_x)
  args : (Tensor[] grad_x_grad, Scalar axis = 0)
  output : Tensor(grad_out_grad)
242
  invoke : concat(grad_x_grad, axis)
Z
zyfncg 已提交
243

244
- backward_op : concat_grad
Z
zyfncg 已提交
245 246 247 248 249 250 251 252 253 254 255
  forward : concat (Tensor[] x, Scalar axis) -> Tensor(out)
  args : (Tensor[] x, Tensor out_grad, Scalar axis = 0)
  output : Tensor[](x_grad){x.size()}
  infer_meta :
    func : UnchangedMultiInferMeta
    param : [x]
  kernel :
    func : concat_grad
  no_need_buffer : x
  backward : concat_double_grad

256
- backward_op : conv2d_grad
257 258
  forward : conv2d (Tensor input, Tensor filter, int[] strides, int[] paddings, str padding_algorithm, int[] dilations, int groups, str data_format) -> Tensor(out)
  args : (Tensor input, Tensor filter, Tensor out_grad,  int[] strides, int[] paddings, str padding_algorithm, int[] dilations, int groups, str data_format)
Z
zyfncg 已提交
259
  output : Tensor(input_grad), Tensor(filter_grad)
Z
zyfncg 已提交
260 261 262 263 264
  infer_meta :
    func : GeneralBinaryGradInferMeta
    param : [input, filter]
  kernel :
    func : conv2d_grad
Z
zyfncg 已提交
265 266
  backward : conv2d_grad_grad

267
- backward_op : conv2d_grad_grad
268 269
  forward : conv2d_grad (Tensor input, Tensor filter, Tensor grad_out,  int[] strides, int[] paddings, str padding_algorithm, int[] dilations, int groups, str data_format) -> Tensor(grad_input), Tensor(grad_filter)
  args : (Tensor input, Tensor filter, Tensor grad_out, Tensor grad_input_grad, Tensor grad_filter_grad, int[] strides, int[] paddings, str padding_algorithm, int[] dilations, int groups, str data_format)
Z
zyfncg 已提交
270 271 272 273 274 275 276 277
  output : Tensor(input_grad), Tensor(filter_grad), Tensor(grad_out_grad)
  infer_meta :
    func : GeneralTernaryGradInferMeta
    param: [input, filter, grad_out]
  kernel :
    func : conv2d_grad_grad
  optional : grad_input_grad, grad_filter_grad

278
- backward_op : conv2d_transpose_double_grad
279 280
  forward : conv2d_transpose_grad(Tensor x, Tensor filter, Tensor grad_out, int[] strides, int[] paddings, int[] output_padding, IntArray output_size, str padding_algorithm, int groups, int[] dilations, str data_format) -> Tensor(grad_x), Tensor(grad_filter)
  args : (Tensor x, Tensor filter, Tensor grad_out, Tensor grad_x_grad, Tensor grad_filter_grad, int[] strides, int[] paddings, int[] output_padding, IntArray output_size, str padding_algorithm, int groups, int[] dilations, str data_format)
Z
zyfncg 已提交
281 282 283 284 285 286
  output : Tensor(x_grad), Tensor(filter_grad), Tensor(grad_out_grad)
  infer_meta :
    func : Conv2dTransposeDoubleGradInferMeta
  kernel :
    func : conv2d_transpose_grad_grad

287
- backward_op : conv2d_transpose_grad
288 289
  forward : conv2d_transpose(Tensor x, Tensor filter, int[] strides, int[] paddings, int[] output_padding, IntArray output_size, str padding_algorithm, int groups, int[] dilations, str data_format) -> Tensor(out)
  args : (Tensor x, Tensor filter, Tensor out_grad, int[] strides, int[] paddings, int[] output_padding, IntArray output_size, str padding_algorithm, int groups, int[] dilations, str data_format)
Z
zyfncg 已提交
290 291
  output : Tensor(x_grad), Tensor(filter_grad)
  infer_meta :
292
    func : Conv2dTransposeGradInferMeta
Z
zyfncg 已提交
293 294 295 296
  kernel :
    func : conv2d_transpose_grad
  backward : conv2d_transpose_double_grad

297 298 299 300 301 302 303 304 305 306 307
- backward_op : conv3d_double_grad
  forward : conv3d_grad (Tensor input, Tensor filter, Tensor grad_out,  int[] strides, int[] paddings, str padding_algorithm, int groups, int[] dilations, str data_format) -> Tensor(grad_input), Tensor(grad_filter)
  args : (Tensor input, Tensor filter, Tensor grad_out, Tensor grad_input_grad, Tensor grad_filter_grad, int[] strides, int[] paddings, str padding_algorithm, int groups, int[] dilations, str data_format)
  output : Tensor(input_grad), Tensor(filter_grad), Tensor(grad_out_grad)
  infer_meta :
    func : GeneralTernaryGradInferMeta
    param: [input, filter, grad_out]
  kernel :
    func : conv3d_double_grad
  optional : grad_input_grad, grad_filter_grad

308
- backward_op : conv3d_grad
309 310
  forward : conv3d (Tensor input, Tensor filter, int[] strides, int[] paddings, str padding_algorithm, int groups, int[] dilations, str data_format) -> Tensor(out)
  args : (Tensor input, Tensor filter, Tensor out_grad,  int[] strides, int[] paddings, str padding_algorithm, int groups, int[] dilations, str data_format)
Z
zyfncg 已提交
311
  output : Tensor(input_grad), Tensor(filter_grad)
Z
zyfncg 已提交
312 313 314 315 316
  infer_meta :
    func : GeneralBinaryGradInferMeta
    param : [input, filter]
  kernel :
    func : conv3d_grad
317
  backward : conv3d_double_grad
Z
zyfncg 已提交
318

319
- backward_op : conv3d_transpose_grad
Z
zyfncg 已提交
320 321 322 323 324 325 326 327
  forward : conv3d_transpose(Tensor x, Tensor filter, int[] strides, int[] paddings, int[] output_padding, int[] output_size, str padding_algorithm, int groups, int[] dilations, str data_format) -> Tensor(out)
  args : (Tensor x, Tensor filter, Tensor out_grad, int[] strides, int[] paddings, int[] output_padding, int[] output_size, str padding_algorithm, int groups, int[] dilations, str data_format)
  output : Tensor(x_grad), Tensor(filter_grad)
  infer_meta :
    func : ConvTransposeGradInferMeta
  kernel :
    func : conv3d_transpose_grad

328
- backward_op : crop_grad
329 330 331 332
  forward : crop_tensor (Tensor x, IntArray shape, IntArray offsets) -> Tensor(out)
  args : (Tensor x, Tensor out_grad, IntArray offsets)
  output : Tensor(x_grad)
  infer_meta :
333
    func : CropGradInferMeta
334
  kernel :
335
    func : crop_grad
336 337
    data_type : x

338
- backward_op : cross_entropy_with_softmax_grad
Z
zyfncg 已提交
339 340 341 342 343 344 345 346 347 348
  forward : cross_entropy_with_softmax (Tensor input, Tensor label, bool soft_label, bool use_softmax, bool numeric_stable_mode, int ignore_index, int axis) -> Tensor(softmax), Tensor(loss)
  args : (Tensor label, Tensor softmax, Tensor loss_grad, bool soft_label, bool use_softmax, bool numeric_stable_mode, int ignore_index, int axis)
  output : Tensor(input_grad)
  infer_meta :
    func : CrossEntropyWithSoftmaxGradInferMeta
  kernel :
    func : cross_entropy_with_softmax_grad
    data_type : softmax
  inplace : (softmax -> input_grad)

349
- backward_op : cumprod_grad
Z
zyfncg 已提交
350 351 352 353 354 355 356 357 358
  forward : cumprod (Tensor x, int dim) -> Tensor(out)
  args : (Tensor x, Tensor out, Tensor out_grad, int dim)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param: [x]
  kernel :
    func : cumprod_grad

359
- backward_op : cumsum_grad
W
WangZhen 已提交
360 361
  forward : cumsum(Tensor x, Scalar axis, bool flatten, bool exclusive, bool reverse) -> Tensor(out)
  args : (Tensor out_grad, Scalar axis, bool flatten, bool exclusive, bool reverse)
Z
zyfncg 已提交
362 363 364
  output : Tensor(x_grad)
  invoke : cumsum(out_grad, axis, flatten, exclusive, !reverse)

365
- backward_op : deformable_conv_grad
Z
zyfncg 已提交
366 367 368 369 370 371 372 373 374 375
  forward : deformable_conv(Tensor x, Tensor offset, Tensor filter, Tensor mask, int[] strides, int[] paddings, int[] dilations, int deformable_groups, int groups, int im2col_step) -> Tensor(out)
  args : (Tensor x, Tensor offset, Tensor filter, Tensor mask, Tensor out_grad, int[] strides, int[] paddings, int[] dilations, int deformable_groups, int groups, int im2col_step)
  output : Tensor(x_grad), Tensor(offset_grad), Tensor(filter_grad), Tensor(mask_grad)
  infer_meta :
    func : DeformableConvGradInferMeta
  kernel :
    func : deformable_conv_grad
    data_type : x
  optional : mask

376
- backward_op : depthwise_conv2d_double_grad
377
  forward : depthwise_conv2d_grad (Tensor input, Tensor filter, Tensor grad_out, int[] strides, int[] paddings, str padding_algorithm, int groups, int[] dilations, str data_format) -> Tensor(grad_input), Tensor(grad_filter)
378 379 380 381 382 383 384 385 386
  args : (Tensor input, Tensor filter, Tensor grad_out, Tensor grad_input_grad, Tensor grad_filter_grad, int[] strides, int[] paddings, str padding_algorithm, int groups, int[] dilations, str data_format)
  output : Tensor(input_grad), Tensor(filter_grad), Tensor(grad_out_grad)
  infer_meta :
    func : GeneralTernaryGradInferMeta
    param: [input, filter, grad_out]
  kernel :
    func : depthwise_conv2d_double_grad
  optional : grad_input_grad, grad_filter_grad

387
- backward_op : depthwise_conv2d_grad
388 389
  forward : depthwise_conv2d (Tensor input, Tensor filter, int[] strides, int[] paddings, str padding_algorithm, int groups, int[] dilations, str data_format) -> Tensor(out)
  args : (Tensor input, Tensor filter, Tensor out_grad, int[] strides, int[] paddings, str padding_algorithm, int groups, int[] dilations, str data_format)
Z
zyfncg 已提交
390 391 392 393 394 395
  output : Tensor(input_grad), Tensor(filter_grad)
  infer_meta :
    func : GeneralBinaryGradInferMeta
    param : [input, filter]
  kernel :
    func : depthwise_conv2d_grad
396 397
    param : [input, filter, out_grad, strides, paddings, padding_algorithm, groups, dilations, data_format]
  backward : depthwise_conv2d_double_grad
Z
zyfncg 已提交
398

399
- backward_op : depthwise_conv2d_transpose_grad
400 401
  forward : depthwise_conv2d_transpose(Tensor x, Tensor filter, int[] strides, int[] paddings, int[] output_padding, IntArray output_size, str padding_algorithm, int groups, int[] dilations, str data_format) -> Tensor(out)
  args : (Tensor x, Tensor filter, Tensor out_grad, int[] strides, int[] paddings, int[] output_padding, IntArray output_size, str padding_algorithm, int groups, int[] dilations, str data_format)
Z
zyfncg 已提交
402 403
  output : Tensor(x_grad), Tensor(filter_grad)
  infer_meta :
404
    func : Conv2dTransposeGradInferMeta
Z
zyfncg 已提交
405 406 407
  kernel :
    func : depthwise_conv2d_transpose_grad

408
- backward_op : divide_double_grad
Z
zyfncg 已提交
409 410 411 412 413 414 415 416 417 418 419 420
  forward : divide_grad (Tensor x, Tensor y, Tensor out, Tensor grad_out, int axis = -1) -> Tensor(grad_x), Tensor(grad_y)
  args : (Tensor y, Tensor out, Tensor grad_x, Tensor grad_x_grad, Tensor grad_y_grad, int axis = -1)
  output : Tensor(y_grad), Tensor(out_grad), Tensor(grad_out_grad)
  infer_meta :
    func : GeneralTernaryGradInferMeta
    param : [y, grad_x, grad_x]
  kernel :
    func : divide_double_grad
    data_type : out
  optional : grad_x_grad, grad_y_grad
  inplace : (grad_x_grad -> grad_out_grad)

421
- backward_op : divide_grad
Z
zyfncg 已提交
422 423 424 425 426 427 428 429 430 431
  forward : divide (Tensor x, Tensor y) -> Tensor(out)
  args : (Tensor x, Tensor y, Tensor out, Tensor out_grad, int axis = -1)
  output : Tensor(x_grad), Tensor(y_grad)
  infer_meta :
    func : GeneralBinaryGradInferMeta
    param : [x, y]
  kernel :
    func : divide_grad
  backward : divide_double_grad

432
- backward_op : dropout_grad
433 434
  forward : dropout (Tensor x, Tensor seed_tensor, Scalar p, bool is_test, str mode, int seed, bool fix_seed) -> Tensor(out), Tensor(mask)
  args : (Tensor mask, Tensor out_grad, Scalar p, bool is_test, str mode)
Z
zyfncg 已提交
435 436 437 438 439 440 441
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [out_grad]
  kernel :
    func : dropout_grad

442
- backward_op : eigvalsh_grad
443 444 445 446 447 448 449 450 451 452 453
  forward : eigvalsh (Tensor x, str uplo, bool is_test) -> Tensor(eigenvalues), Tensor(eigenvectors)
  args : (Tensor eigenvectors, Tensor eigenvalues_grad, str uplo, bool is_test)
  output : Tensor(x_grad)
  infer_meta :
    func : EigvalshGradInferMeta
  kernel :
    func : eigvalsh_grad
    data_type : eigenvectors
  data_transform :
    skip_transform : eigenvalues_grad

454
- backward_op : einsum_grad
Z
zyfncg 已提交
455 456 457 458 459 460 461 462 463
  forward : einsum (Tensor[] x, str equation) -> Tensor(out), Tensor[](inner_cache), Tensor[](x_shape)
  args : (Tensor[] x_shape, Tensor[] inner_cache, Tensor out_grad, str equation)
  output : Tensor[](x_grad){x.size()}
  infer_meta :
    func : UnchangedMultiInferMeta
    param : [x_shape]
  kernel :
    func : einsum_grad

464
- backward_op : elementwise_pow_grad
Z
zyfncg 已提交
465 466 467 468 469 470 471 472 473
  forward : elementwise_pow(Tensor x, Tensor y) -> Tensor(out)
  args : (Tensor x, Tensor y, Tensor out_grad, int axis=-1)
  output : Tensor(x_grad), Tensor(y_grad)
  infer_meta :
    func : GeneralBinaryGradInferMeta
    param: [x, y]
  kernel :
    func : elementwise_pow_grad

474
- backward_op : embedding_grad
Z
zyfncg 已提交
475 476 477 478
  forward : embedding (Tensor x, Tensor weight, int64_t padding_idx=-1, bool sparse=false) -> Tensor(out)
  args : (Tensor x, Tensor weight, Tensor out_grad, int64_t padding_idx=-1, bool sparse=false)
  output : Tensor(weight_grad)
  invoke : embedding_grad_impl(x, weight, out_grad, padding_idx, sparse, weight_grad)
W
wanghuancoder 已提交
479
  no_need_buffer : weight
Z
zyfncg 已提交
480

481
- backward_op : expand_as_grad
Z
zyfncg 已提交
482 483 484 485 486 487 488 489 490 491
  forward : expand_as (Tensor x, Tensor y, int[] target_shape) -> Tensor(out)
  args : (Tensor x, Tensor out_grad, int[] target_shape)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : expand_as_grad
  no_need_buffer : x

492
- backward_op : expand_double_grad
Z
zyfncg 已提交
493 494 495
  forward : expand_grad (Tensor x, Tensor grad_out, IntArray shape) -> Tensor(grad_x)
  args : (Tensor grad_x_grad, IntArray shape)
  output : Tensor(grad_out_grad)
496
  invoke : expand(grad_x_grad, shape)
Z
zyfncg 已提交
497

498
- backward_op : expand_grad
Z
zyfncg 已提交
499 500 501 502 503 504 505 506 507 508 509
  forward : expand (Tensor x, IntArray shape) -> Tensor(out)
  args : (Tensor x, Tensor out_grad, IntArray shape)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : expand_grad
  no_need_buffer : x
  backward : expand_double_grad

510
- backward_op : exponential__grad
511
  forward : exponential_ (Tensor x, float lam) -> Tensor(out)
512 513 514 515
  args : (Tensor out_grad)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
516
  invoke : zeros_like(out_grad)
517

518
- backward_op : fill_diagonal_grad
Z
zhiboniu 已提交
519 520 521 522 523 524 525
  forward : fill_diagonal (Tensor x, float value, int offset, bool wrap) -> Tensor(out)
  args : (Tensor out_grad, float value, int offset, bool wrap)
  output : Tensor(x_grad)
  infer_meta :
    func : FillDiagonalGradInferMeta
  kernel :
    func : fill_diagonal_grad
Z
zhiboniu 已提交
526

527
- backward_op : fill_grad
528 529 530 531 532 533 534 535 536 537
  forward : fill (Tensor x, Scalar value) -> Tensor(out)
  args : (Tensor out_grad, Scalar value)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [out_grad]
  kernel :
    func : fill_grad
  inplace : (out_grad -> x_grad)

538
- backward_op : flatten_grad
Z
zyfncg 已提交
539 540 541 542 543 544 545 546 547 548 549 550 551
  forward : flatten(Tensor x, int start_axis, int stop_axis) -> Tensor(out), Tensor(xshape)
  args : (Tensor xshape, Tensor out_grad)
  output : Tensor(x_grad)
  infer_meta :
    func :  KernelWithXShapeInferMeta
    param : [xshape]
  kernel :
    func : flatten_grad
    data_type: out_grad
    backend: out_grad
    layout: out_grad
  inplace : (out_grad -> x_grad)

552
- backward_op : fmax_grad
553 554
  forward : fmax(Tensor x, Tensor y) -> Tensor(out)
  args : (Tensor x, Tensor y, Tensor out_grad, int axis = -1)
Z
zyfncg 已提交
555 556 557 558 559 560 561
  output : Tensor(x_grad), Tensor(y_grad)
  infer_meta :
    func : GeneralBinaryGradInferMeta
    param: [x, y]
  kernel :
    func : fmax_grad

562
- backward_op : fmin_grad
563 564
  forward : fmin(Tensor x, Tensor y) -> Tensor(out)
  args : (Tensor x, Tensor y, Tensor out_grad, int axis = -1)
Z
zyfncg 已提交
565 566 567 568 569 570 571
  output : Tensor(x_grad), Tensor(y_grad)
  infer_meta :
    func : GeneralBinaryGradInferMeta
    param: [x, y]
  kernel :
    func : fmin_grad

572
- backward_op : frame_grad
C
Charles-hit 已提交
573 574 575 576 577 578 579 580 581
  forward : frame(Tensor x, int frame_length, int hop_length, int axis) -> Tensor(out)
  args : (Tensor x, Tensor out_grad, int frame_length, int hop_length, int axis)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : frame_grad

582
- backward_op : frobenius_norm_grad
Z
zyfncg 已提交
583 584 585 586 587 588 589 590 591
  forward : frobenius_norm(Tensor x, int64_t[] axis,  bool keep_dim,  bool reduce_all) -> Tensor(out)
  args : (Tensor x, Tensor out, Tensor out_grad, int64_t[] axis,  bool keep_dim,  bool reduce_all)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : frobenius_norm_grad

592
- backward_op : gather_grad
Z
zyfncg 已提交
593 594 595 596 597 598 599 600 601 602 603
  forward : gather(Tensor x, Tensor index, Scalar axis=0) -> Tensor(out)
  args : (Tensor x, Tensor index, Tensor out_grad, Scalar axis=0, bool overwrite=false)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param: [x]
  kernel :
    data_type: x
    func : gather_grad
  no_need_buffer : x

604
- backward_op : gather_nd_grad
Z
zyfncg 已提交
605 606 607 608 609 610 611 612 613 614
  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
  no_need_buffer : x

615
- backward_op : group_norm_grad
Z
zyfncg 已提交
616 617 618 619 620 621 622 623 624 625 626 627
  forward : group_norm (Tensor x, Tensor scale, Tensor bias, float epsilon, int groups, str data_layout) -> Tensor(y), Tensor(mean), Tensor(variance)
  args : (Tensor x, Tensor scale, Tensor bias, Tensor y, Tensor mean, Tensor variance, Tensor y_grad, float epsilon, int groups, str data_layout)
  output : Tensor(x_grad), Tensor(scale_grad), Tensor(bias_grad)
  infer_meta :
    func : GeneralTernaryGradInferMeta
    param : [y, scale, bias]
  kernel :
    func : group_norm_grad
    data_type : y_grad
  optional: scale, bias
  inplace : (y_grad -> x_grad)

628
- backward_op : hardswish_grad
629 630
  forward : hardswish (Tensor x) -> Tensor(out)
  args : (Tensor x, Tensor out_grad, float threshold = 6.0, float scale = 6.0, float offset = 3.0)
Z
zyfncg 已提交
631 632 633 634 635 636 637 638
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : hard_swish_grad
  inplace : (out_grad -> x_grad)

639 640 641 642 643 644 645 646 647 648 649
- backward_op : hardtanh_grad
  forward : hardtanh (Tensor x, float t_min, float t_max) -> Tensor(out)
  args : (Tensor x, Tensor out_grad, float t_min, float t_max)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : hard_tanh_grad
  inplace : (out_grad -> x_grad)

650
- backward_op : hsigmoid_loss_grad
651 652
  forward : hsigmoid_loss (Tensor x, Tensor label, Tensor w, Tensor bias, Tensor path, Tensor code, int num_classes, bool remote_prefetch, bool is_sparse) -> Tensor(out), Tensor(pre_out), Tensor(w_out)
  args : (Tensor x, Tensor w, Tensor label, Tensor path, Tensor code, Tensor bias, Tensor pre_out, Tensor out_grad, int num_classes, bool remote_prefetch, bool is_sparse)
653 654 655 656 657 658
  output : Tensor(x_grad), Tensor(w_grad), Tensor(bias_grad)
  infer_meta :
    func : GeneralTernaryGradInferMeta
    param : [x ,w, bias]
  optional: path, code, bias
  kernel :
659
    func : hsigmoid_loss_grad
660

661
- backward_op : huber_loss_grad
Z
zyfncg 已提交
662 663 664 665 666 667 668 669 670
  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 : [residual, residual]
  kernel :
    func : huber_loss_grad

671
- backward_op : imag_grad
Z
zyfncg 已提交
672 673 674 675 676
  forward : imag (Tensor x) -> Tensor(out)
  args : (Tensor out_grad)
  output : Tensor(x_grad)
  invoke : imag_grad_impl(out_grad, x_grad)

677 678 679 680 681 682
- backward_op : increment_grad
  forward : increment (Tensor x, float value) -> Tensor(out)
  args : (Tensor out, float value)
  output : Tensor(x_grad)
  invoke : increment (out, -value)

683
- backward_op : index_add_grad
L
Li Min 已提交
684 685 686 687 688 689 690 691 692 693
  forward : index_add(Tensor x, Tensor index,  Tensor add_value, int axis) -> Tensor(out)
  args : (Tensor index, Tensor add_value, Tensor out_grad, int axis)
  output : Tensor(x_grad), Tensor(add_value_grad)
  infer_meta :
    func : IndexAddGradInferMeta
  kernel :
    func : index_add_grad
    data_type : out_grad
  inplace : (out_grad -> x_grad)

694
- backward_op : instance_norm_double_grad
Z
zyfncg 已提交
695 696 697 698 699 700 701 702 703 704
  forward : instance_norm_grad(Tensor x, Tensor fwd_scale, Tensor saved_mean, Tensor saved_variance, Tensor grad_y, float epsilon) -> Tensor(grad_x), Tensor(grad_scale), Tensor(grad_bias)
  args : (Tensor x, Tensor fwd_scale, Tensor saved_mean, Tensor saved_variance, Tensor grad_y, Tensor grad_x_grad, Tensor grad_scale_grad, Tensor grad_bias_grad, float epsilon)
  output : Tensor(x_grad), Tensor(fwd_scale_grad), Tensor(grad_y_grad)
  infer_meta :
    func : InstanceNormDoubleGradInferMeta
  kernel :
    func : instance_norm_double_grad
    data_type : x
  optional : fwd_scale, grad_x_grad, grad_scale_grad, grad_bias_grad

705
- backward_op : instance_norm_grad
Z
zyfncg 已提交
706 707 708 709 710 711 712 713 714 715 716
  forward : instance_norm(Tensor x, Tensor scale, Tensor bias, float epsilon) -> Tensor(y), Tensor(saved_mean), Tensor(saved_variance)
  args : (Tensor x, Tensor scale, Tensor saved_mean, Tensor saved_variance, Tensor y_grad, float epsilon)
  output : Tensor(x_grad), Tensor(scale_grad), Tensor(bias_grad)
  infer_meta :
    func : InstanceNormGradInferMeta
  kernel :
    func : instance_norm_grad
    data_type : x
  optional : scale
  backward : instance_norm_double_grad

717
- backward_op : kldiv_loss_grad
Z
zyfncg 已提交
718 719 720 721 722 723 724 725 726 727
  forward : kldiv_loss(Tensor x, Tensor label, str reduction) -> Tensor(out)
  args : (Tensor x, Tensor label, Tensor out_grad, str reduction)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param: [x]
  kernel :
    func : kldiv_loss_grad
  no_need_buffer : x

728
- backward_op : kron_grad
Z
zyfncg 已提交
729 730 731 732 733 734 735 736 737 738
  forward : kron (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 : kron_grad
    data_type : out_grad

739
- backward_op : kthvalue_grad
Z
zyfncg 已提交
740 741 742 743 744 745 746 747 748
  forward : kthvalue(Tensor x, int k, int axis, bool keepdim) -> Tensor(out), Tensor(indices)
  args : (Tensor x, Tensor indices, Tensor out_grad, int k, int axis, bool keepdim)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param: [x]
  kernel :
    func : kthvalue_grad

749
- backward_op : label_smooth_grad
Z
zyfncg 已提交
750 751 752 753 754 755 756 757 758
  forward : label_smooth (Tensor label, Tensor prior_dist, float epsilon) -> Tensor(out)
  args : (Tensor out_grad, float epsilon)
  output : Tensor(label_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [out_grad]
  kernel :
    func : label_smooth_grad

759
- backward_op : layer_norm_grad
760 761
  forward : layer_norm (Tensor x, Tensor scale, Tensor bias, float epsilon, int begin_norm_axis) -> Tensor(out), Tensor(mean), Tensor(variance)
  args : (Tensor x,  Tensor scale, Tensor bias, Tensor mean, Tensor variance, Tensor out_grad, float epsilon, int begin_norm_axis)
Z
zyfncg 已提交
762 763 764 765 766 767 768 769 770 771
  output : Tensor(x_grad), Tensor(scale_grad), Tensor(bias_grad)
  infer_meta :
    func : LayerNormGradInferMeta
    param : [x, scale, bias]
  kernel :
    func : layer_norm_grad
    data_type : out_grad
  no_need_buffer : bias
  optional : scale, bias

772
- backward_op : lerp_grad
Z
zyfncg 已提交
773 774 775 776 777 778 779 780 781
  forward : lerp (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

782
- backward_op : linear_interp_grad
783
  forward : linear_interp (Tensor x, Tensor out_size, Tensor[] size_tensor, Tensor scale_tensor, str data_layout, int out_d, int out_h, int out_w, float[] scale, str interp_method, bool align_corners, int align_mode) -> Tensor(output)
784 785 786 787 788 789 790
  args : (Tensor x, Tensor out_size, Tensor[] size_tensor, Tensor scale_tensor, Tensor output_grad, str data_layout, int out_d, int out_h, int out_w, float[] scale, str interp_method, bool align_corners, int align_mode)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param: [x]
  optional: out_size, size_tensor, scale_tensor
  kernel :
791
    func : linear_interp_grad
792 793
    data_type : output_grad

794
- backward_op : log_loss_grad
Z
zyfncg 已提交
795 796 797 798 799 800 801 802 803
  forward : log_loss (Tensor input, Tensor label, float epsilon) -> Tensor(out)
  args : (Tensor input, Tensor label, Tensor out_grad, float epsilon)
  output : Tensor(input_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [input]
  kernel :
    func : log_loss_grad

804
- backward_op : log_softmax_grad
Z
zyfncg 已提交
805 806 807 808 809 810 811 812 813
  forward : log_softmax(Tensor x,  int axis) -> Tensor(out)
  args : (Tensor out, Tensor out_grad,  int axis)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param: [out]
  kernel :
    func : log_softmax_grad

814
- backward_op : logcumsumexp_grad
Z
zyfncg 已提交
815 816 817 818 819 820 821 822 823
  forward : logcumsumexp(Tensor x, int axis, bool flatten, bool exclusive, bool reverse) -> Tensor(out)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  args : (Tensor x, Tensor out, Tensor out_grad, int axis, bool flatten, bool exclusive, bool reverse)
  output : Tensor(x_grad)
  kernel :
    func : logcumsumexp_grad

824
- backward_op : logsumexp_grad
Z
zyfncg 已提交
825 826 827 828 829 830 831 832 833
  forward : logsumexp(Tensor x, int64_t[] axis,  bool keepdim,  bool reduce_all) -> Tensor(out)
  args : (Tensor x, Tensor out, Tensor out_grad, int64_t[] axis,  bool keepdim,  bool reduce_all)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param: [x]
  kernel :
    func : logsumexp_grad

834
- backward_op : lu_grad
L
Lin Manhui 已提交
835 836 837 838 839 840 841 842
  forward : lu (Tensor x, bool pivot) -> Tensor(out), Tensor(pivots), Tensor(infos)
  args : (Tensor x, Tensor out, Tensor pivots, Tensor out_grad, bool pivot)
  output : Tensor(x_grad)
  infer_meta :
    func : LUGradInferMeta
  kernel :
    func : lu_grad

843
- backward_op : lu_unpack_grad
844 845
  forward : lu_unpack (Tensor x, Tensor y, bool unpack_ludata, bool unpack_pivots) -> Tensor(pmat), Tensor(l), Tensor(u)
  args : (Tensor x, Tensor y, Tensor l, Tensor u, Tensor pmat, Tensor l_grad, Tensor u_grad, bool unpack_ludata, bool unpack_pivots)
846 847 848 849 850 851
  output : Tensor(x_grad)
  infer_meta :
    func : LUUnpackGradInferMeta
  kernel :
    func : lu_unpack_grad

852
- backward_op : margin_cross_entropy_grad
853 854 855 856 857 858 859 860 861 862
  forward : margin_cross_entropy (Tensor logits, Tensor label, bool return_softmax, int ring_id, int rank, int nranks, float margin1, float margin2, float margin3, float scale) -> Tensor(softmax), Tensor(loss)
  args : (Tensor logits, Tensor label, Tensor softmax, Tensor loss_grad, bool return_softmax, int ring_id, int rank, int nranks, float margin1, float margin2, float margin3, float scale)
  output : Tensor(logits_grad)
  infer_meta :
    func : MarginCrossEntropyGradInferMeta
  kernel :
    func : margin_cross_entropy_grad
    data_type : softmax
  inplace : (softmax -> logits_grad)

863
- backward_op : masked_select_grad
Z
zyfncg 已提交
864 865 866 867 868 869 870 871 872 873 874
  forward : masked_select (Tensor x, Tensor mask) -> Tensor(out)
  args : (Tensor x, Tensor mask, Tensor out_grad)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : masked_select_grad
    data_type : x
  no_need_buffer : x

875
- backward_op : matmul_double_grad
Z
zyfncg 已提交
876 877 878 879 880 881 882 883 884 885 886
  forward : matmul_grad (Tensor x, Tensor y, Tensor grad_out, bool transpose_x=false, bool transpose_y=false) -> Tensor(grad_x), Tensor(grad_y)
  args : (Tensor x, Tensor y, Tensor grad_out, Tensor grad_x_grad, Tensor grad_y_grad, bool transpose_x=false, bool transpose_y=false)
  output : Tensor(x_grad), Tensor(y_grad), Tensor(grad_out_grad)
  infer_meta :
    func : GeneralTernaryGradInferMeta
    param : [x, y, grad_out]
  kernel :
    func : matmul_double_grad
  backward : matmul_triple_grad
  optional : grad_x_grad, grad_y_grad

887
- backward_op : matmul_grad
Z
zyfncg 已提交
888 889 890 891 892 893 894 895 896 897
  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 : matmul_double_grad

898
- backward_op : matmul_triple_grad
Z
zyfncg 已提交
899 900 901 902 903 904 905 906 907 908
  forward : matmul_double_grad (Tensor x, Tensor y, Tensor fwd_grad_out, Tensor fwd_grad_grad_x, Tensor fwd_grad_grad_y, bool transpose_x=false, bool transpose_y=false) -> Tensor(grad_x), Tensor(grad_y), Tensor(grad_grad_out)
  args : (Tensor x, Tensor y, Tensor fwd_grad_out, Tensor fwd_grad_grad_x, Tensor fwd_grad_grad_y, Tensor grad_x_grad, Tensor grad_y_grad, Tensor grad_grad_out_grad, bool transpose_x=false, bool transpose_y=false)
  output : Tensor(x_grad), Tensor(y_grad), Tensor(fwd_grad_out_grad), Tensor(fwd_grad_grad_x_grad), Tensor(fwd_grad_grad_y_grad)
  infer_meta :
    func : GeneralQuinaryGradInferMeta
    param : [x, y, fwd_grad_out, fwd_grad_grad_x, fwd_grad_grad_y]
  kernel :
    func : matmul_triple_grad
  optional : grad_x_grad, grad_y_grad, grad_grad_out_grad

909
- backward_op : matrix_power_grad
Z
zyfncg 已提交
910 911 912 913 914 915 916 917 918
  forward : matrix_power (Tensor x, int n) -> Tensor(out)
  args : (Tensor x, Tensor out, Tensor out_grad, int n)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : matrix_power_grad

919
- backward_op : max_grad
920 921
  forward: max (Tensor x,  IntArray axis={},  bool keepdim=false) -> Tensor(out)
  args : (Tensor x, Tensor out, Tensor out_grad, IntArray axis={}, bool keepdim=false, bool reduce_all=false)
Z
zyfncg 已提交
922 923 924 925 926 927 928
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param: [x]
  kernel :
    func : max_grad

929
- backward_op : max_pool2d_with_index_grad
Z
zyfncg 已提交
930 931 932 933 934 935 936 937
  forward : max_pool2d_with_index(Tensor x, int[] kernel_size, int[] strides, int[] paddings, bool global_pooling, bool adaptive) -> Tensor(out), Tensor(mask)
  args : (Tensor x, Tensor mask, Tensor out_grad, int[] kernel_size, int[] strides, int[] paddings, bool global_pooling, bool adaptive)
  output : Tensor(x_grad)
  infer_meta :
    func : MaxPoolWithIndexGradInferMeta
  kernel :
    func : max_pool2d_with_index_grad

938
- backward_op : max_pool3d_with_index_grad
Z
zyfncg 已提交
939 940 941 942 943 944 945 946
  forward : max_pool3d_with_index(Tensor x, int[] kernel_size, int[] strides, int[] paddings, bool global_pooling, bool adaptive) -> Tensor(out), Tensor(mask)
  args : (Tensor x, Tensor mask, Tensor out_grad, int[] kernel_size, int[] strides, int[] paddings, bool global_pooling, bool adaptive)
  output : Tensor(x_grad)
  infer_meta :
    func : MaxPoolWithIndexGradInferMeta
  kernel :
    func : max_pool3d_with_index_grad

947
- backward_op : maximum_grad
Z
zyfncg 已提交
948 949 950 951 952 953 954 955 956
  forward : maximum(Tensor x, Tensor y) -> Tensor(out)
  args : (Tensor x, Tensor y, Tensor out_grad, int axis=-1)
  output : Tensor(x_grad), Tensor(y_grad)
  infer_meta :
    func : GeneralBinaryGradInferMeta
    param: [x, y]
  kernel :
    func : maximum_grad

957
- backward_op : maxout_grad
Z
zyfncg 已提交
958 959 960 961 962 963 964 965 966
  forward : maxout(Tensor x, int groups, int axis) -> Tensor(out)
  args : (Tensor x, Tensor out, Tensor out_grad, int groups, int axis)
  output : Tensor(x_grad)
  infer_meta :
    func : GeneralUnaryGradInferMeta
    param: [x]
  kernel :
    func : maxout_grad

967
- backward_op : mean_all_grad
Z
zyfncg 已提交
968 969 970 971 972 973 974 975 976
  forward : mean_all(Tensor x) -> Tensor(out)
  args : (Tensor x, Tensor out_grad)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param: [x]
  kernel :
    func : mean_all_grad

977
- backward_op : mean_double_grad
978 979
  forward: mean_grad (Tensor x, Tensor grad_out, IntArray axis={},  bool keepdim=false, bool reduce_all = false) -> Tensor(grad_x)
  args : (Tensor grad_x_grad, IntArray axis={},  bool keepdim=false)
Z
zyfncg 已提交
980
  output : Tensor(grad_out_grad)
981
  invoke : mean(grad_x_grad, axis, keepdim)
Z
zyfncg 已提交
982

983
- backward_op : mean_grad
984 985
  forward: mean (Tensor x,  IntArray axis={},  bool keepdim=false) -> Tensor(out)
  args : (Tensor x, Tensor out_grad, IntArray axis={},  bool keepdim=false, bool reduce_all=false)
Z
zyfncg 已提交
986 987 988 989 990 991 992 993 994
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param: [x]
  kernel :
    func : mean_grad
  backward : mean_double_grad
  no_need_buffer : x

995
- backward_op : meshgrid_grad
Z
zyfncg 已提交
996 997 998 999 1000 1001 1002 1003
  forward : meshgrid (Tensor[] inputs) -> Tensor[](outputs)
  args : (Tensor[] inputs, Tensor[] outputs_grad)
  output : Tensor[](inputs_grad){inputs.size()}
  infer_meta :
    func : MeshgridGradInferMeta
  kernel :
    func : meshgrid_grad

1004
- backward_op : min_grad
1005 1006
  forward: min (Tensor x,  IntArray axis={},  bool keepdim=false) -> Tensor(out)
  args : (Tensor x, Tensor out, Tensor out_grad, IntArray axis={}, bool keepdim=false, bool reduce_all=false)
Z
zyfncg 已提交
1007 1008 1009 1010 1011 1012 1013
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param: [x]
  kernel :
    func : min_grad

1014
- backward_op : minimum_grad
Z
zyfncg 已提交
1015 1016 1017 1018 1019 1020 1021 1022 1023
  forward : minimum(Tensor x, Tensor y) -> Tensor(out)
  args : (Tensor x, Tensor y, Tensor out_grad, int axis=-1)
  output : Tensor(x_grad), Tensor(y_grad)
  infer_meta :
    func : GeneralBinaryGradInferMeta
    param: [x, y]
  kernel :
    func : minimum_grad

1024
- backward_op : mish_grad
Z
zyfncg 已提交
1025 1026 1027 1028 1029 1030 1031 1032 1033 1034
  forward : mish (Tensor x, float threshold) -> Tensor(out)
  args : (Tensor x, Tensor out_grad, float threshold)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : mish_grad
  inplace : (out_grad -> x_grad)

1035
- backward_op : mode_grad
Z
zyfncg 已提交
1036 1037 1038 1039 1040 1041 1042 1043 1044
  forward : mode(Tensor x,  int axis,  bool keepdim) -> Tensor(out), Tensor(indices)
  args : (Tensor x, Tensor indices, Tensor out_grad,  int axis,  bool keepdim)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param: [x]
  kernel :
    func : mode_grad

1045
- backward_op : multi_dot_grad
Z
zyfncg 已提交
1046 1047 1048 1049 1050 1051 1052 1053
  forward : multi_dot (Tensor[] x) -> Tensor(out)
  args : (Tensor[] x, Tensor out_grad)
  output : Tensor[](x_grad) {x.size()}
  infer_meta :
    func : MultiDotGradInferMeta
  kernel :
    func : multi_dot_grad

1054
- backward_op : multiplex_grad
1055 1056 1057
  forward : multiplex (Tensor[] inputs, Tensor index) -> Tensor(out)
  args : (Tensor[] inputs, Tensor index, Tensor out_grad)
  output : Tensor[](inputs_grad){inputs.size()}
Z
zyfncg 已提交
1058 1059
  infer_meta :
    func : MultiplexGradInferMeta
1060
    param : [index, out_grad]
Z
zyfncg 已提交
1061 1062
  kernel :
    func : multiplex_grad
1063
    param : [index, out_grad]
Z
zyfncg 已提交
1064

1065
- backward_op : multiply_double_grad
Z
zyfncg 已提交
1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077
  forward : multiply_grad (Tensor x, Tensor y, Tensor grad_out, int axis = -1) -> Tensor(grad_x), Tensor(grad_y)
  args : (Tensor x, Tensor y, Tensor grad_out, Tensor grad_x_grad, Tensor grad_y_grad, int axis = -1)
  output : Tensor(x_grad), Tensor(y_grad), Tensor(grad_out_grad)
  infer_meta :
    func : GeneralTernaryGradInferMeta
    param : [x, y, grad_out]
  kernel :
    func : multiply_double_grad
  optional : grad_x_grad, grad_y_grad
  backward : multiply_triple_grad
  inplace : (grad_x_grad -> grad_out_grad)

1078
- backward_op : multiply_grad
Z
zyfncg 已提交
1079 1080 1081 1082 1083 1084 1085 1086 1087 1088
  forward : multiply (Tensor x, Tensor y) -> Tensor(out)
  args : (Tensor x, Tensor y, Tensor out_grad, int axis = -1)
  output : Tensor(x_grad), Tensor(y_grad)
  infer_meta :
    func : GeneralBinaryGradInferMeta
    param : [x, y]
  kernel :
    func : multiply_grad
  backward : multiply_double_grad

1089
- backward_op : multiply_triple_grad
Z
zyfncg 已提交
1090 1091 1092 1093 1094 1095 1096 1097 1098 1099
  forward : multiply_double_grad (Tensor x, Tensor y, Tensor fwd_grad_out, Tensor fwd_grad_grad_x, Tensor fwd_grad_grad_y, int aixs = -1) -> Tensor(grad_x), Tensor(grad_y), Tensor(grad_grad_out)
  args : (Tensor x, Tensor y, Tensor fwd_grad_out, Tensor fwd_grad_grad_x, Tensor fwd_grad_grad_y, Tensor grad_x_grad, Tensor grad_y_grad, Tensor grad_grad_out_grad, int axis = -1)
  output : Tensor(x_grad), Tensor(y_grad), Tensor(fwd_grad_out_grad), Tensor(fwd_grad_grad_x_grad), Tensor(fwd_grad_grad_y_grad)
  infer_meta :
    func : GeneralQuinaryGradInferMeta
    param : [x, y, fwd_grad_out, x, y]
  kernel :
    func : multiply_triple_grad
  optional : fwd_grad_grad_x, fwd_grad_grad_y, grad_grad_out_grad

1100
- backward_op : nearest_interp_grad
1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111
  forward : nearest_interp (Tensor x, Tensor out_size, Tensor[] size_tensor, Tensor scale_tensor, str data_layout, int out_d, int out_h, int out_w, float[] scale, str interp_method, bool align_corners, int align_mode) -> Tensor(output)
  args : (Tensor x, Tensor out_size, Tensor[] size_tensor, Tensor scale_tensor, Tensor output_grad, str data_layout, int out_d, int out_h, int out_w, float[] scale, str interp_method, bool align_corners, int align_mode)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param: [x]
  optional: out_size, size_tensor, scale_tensor
  kernel :
    func : nearest_interp_grad
    data_type : output_grad

1112
- backward_op : nll_loss_grad
Z
zyfncg 已提交
1113 1114 1115 1116 1117 1118 1119 1120 1121 1122
  forward : nll_loss (Tensor input, Tensor label, Tensor weight, int64_t ignore_index, str reduction) -> Tensor(out), Tensor(total_weight)
  args : (Tensor input, Tensor label, Tensor weight, Tensor total_weight, Tensor out_grad, int64_t ignore_index, str reduction)
  output : Tensor(input_grad)
  infer_meta :
    func : NllLossGradInferMeta
  kernel :
    func : nll_loss_grad
    data_type : input
  optional : weight

1123
- backward_op : norm_grad
Z
zyfncg 已提交
1124 1125 1126 1127 1128 1129 1130 1131 1132
  forward : norm (Tensor x, int axis, float epsilon, bool is_test) -> Tensor(out), Tensor(norm)
  args : (Tensor x, Tensor norm, Tensor out_grad, int axis, float epsilon, bool is_test)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : norm_grad

1133
- backward_op : overlap_add_grad
1134 1135 1136 1137 1138 1139 1140 1141 1142
  forward : overlap_add(Tensor x, int hop_length, int axis) -> Tensor(out)
  args : (Tensor x, Tensor out_grad, int hop_length, int axis)
  output : Tensor(x_grad)
  infer_meta :
    func : OverlapAddGradInferMeta
  kernel :
    func : overlap_add_grad
    data_type : x

1143
- backward_op : p_norm_grad
Z
zyfncg 已提交
1144 1145 1146 1147 1148 1149 1150 1151 1152
  forward : p_norm(Tensor x,  float porder,  int axis,  float epsilon,  bool keepdim,  bool asvector=false) -> Tensor(out)
  args : (Tensor x, Tensor out, Tensor out_grad,  float porder,  int axis,  float epsilon,  bool keepdim,  bool asvector)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param: [x]
  kernel :
    func : p_norm_grad

1153
- backward_op : pad3d_double_grad
Z
zyfncg 已提交
1154 1155 1156 1157 1158 1159 1160 1161
  forward : pad3d_grad(Tensor x, Tensor grad_out, IntArray paddings, str mode, float pad_value, str data_format) -> Tensor(grad_x)
  args : (Tensor grad_x_grad, IntArray paddings, str mode, float pad_value, str data_format)
  output : Tensor(grad_out_grad)
  infer_meta :
    func : Pad3dInferMeta
  kernel :
    func : pad3d

1162
- backward_op : pad3d_grad
Z
zyfncg 已提交
1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173
  forward : pad3d(Tensor x, IntArray paddings, str mode,  float pad_value, str data_format) -> Tensor(out)
  args : (Tensor x, Tensor out_grad, IntArray paddings, str mode,  float pad_value, str data_format)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param: [x]
  kernel :
    func : pad3d_grad
  no_need_buffer : x
  backward : pad3d_double_grad

1174
- backward_op : pad_double_grad
1175 1176
  forward : pad_grad(Tensor x, Tensor grad_out, int[] paddings, Scalar pad_value) -> Tensor(grad_x)
  args : (Tensor grad_x_grad, int[] paddings, Scalar pad_value)
Z
zyfncg 已提交
1177 1178 1179 1180 1181 1182
  output : Tensor(grad_out_grad)
  infer_meta :
    func : PadInferMeta
  kernel :
    func : pad

1183
- backward_op : pad_grad
1184 1185
  forward : pad(Tensor x, int[] paddings, Scalar pad_value) -> Tensor(out)
  args : (Tensor x, Tensor out_grad, int[] paddings, Scalar pad_value)
Z
zyfncg 已提交
1186 1187 1188 1189 1190 1191 1192 1193 1194 1195
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param: [x]
  kernel :
    func : pad_grad
    param: [out_grad, paddings, pad_value]
  no_need_buffer : x
  backward : pad_double_grad

1196
- backward_op : pixel_shuffle_grad
Z
zyfncg 已提交
1197 1198 1199 1200 1201 1202 1203 1204
  forward : pixel_shuffle (Tensor x, int upscale_factor, str data_format) -> Tensor(out)
  args : (Tensor out_grad, int upscale_factor, str data_format)
  output : Tensor(x_grad)
  infer_meta :
    func : PixelShuffleGradInferMeta
  kernel :
    func : pixel_shuffle_grad

1205
- backward_op : pool2d_double_grad
1206 1207
  forward : pool2d_grad(Tensor x, Tensor out, Tensor grad_out, IntArray kernel_size, int[] strides, int[] paddings, bool ceil_mode, bool exclusive, str data_format, str pooling_type, bool global_pooling, bool adaptive, str padding_algorithm) -> Tensor(grad_x)
  args : (Tensor x, Tensor grad_x_grad, IntArray kernel_size, int[] strides, int[] paddings, bool ceil_mode, bool exclusive, str data_format, str pooling_type, bool global_pooling, bool adaptive, str padding_algorithm)
Z
zyfncg 已提交
1208 1209
  output : Tensor(grad_out_grad)
  infer_meta :
1210
    func : Pool2DInferMeta
1211
    param : [grad_x_grad, kernel_size, strides, paddings, ceil_mode, exclusive, data_format, pooling_type, global_pooling, adaptive, padding_algorithm]
Z
zyfncg 已提交
1212 1213
  kernel :
    func : pool2d_double_grad
1214
    param : [grad_x_grad, kernel_size, strides, paddings, ceil_mode, exclusive, data_format, pooling_type, global_pooling, adaptive, padding_algorithm]
1215
  no_need_buffer : x
Z
zyfncg 已提交
1216

1217
- backward_op : pool2d_grad
1218 1219
  forward : pool2d(Tensor x, IntArray kernel_size, int[] strides, int[] paddings, bool ceil_mode, bool exclusive, str data_format, str pooling_type, bool global_pooling, bool adaptive, str padding_algorithm) -> Tensor(out)
  args : (Tensor x, Tensor out, Tensor out_grad, IntArray kernel_size, int[] strides, int[] paddings, bool ceil_mode, bool exclusive, str data_format, str pooling_type, bool global_pooling, bool adaptive, str padding_algorithm)
Z
zyfncg 已提交
1220 1221
  output : Tensor(x_grad)
  infer_meta :
1222 1223
    func : UnchangedInferMeta
    param: [x]
Z
zyfncg 已提交
1224 1225
  kernel :
    func : pool2d_grad
1226
    param : [x, out, out_grad, kernel_size, strides, paddings, ceil_mode, exclusive, data_format, pooling_type, global_pooling, adaptive, padding_algorithm]
Z
zyfncg 已提交
1227 1228
  backward : pool2d_double_grad

1229
- backward_op : pool3d_grad
1230 1231
  forward : pool3d(Tensor x, int[] kernel_size, int[] strides, int[] paddings, bool ceil_mode, bool exclusive, str data_format, str pooling_type, bool global_pooling, bool adaptive, str padding_algorithm) -> Tensor(out)
  args : (Tensor x, Tensor out, Tensor out_grad, int[] kernel_size, int[] strides, int[] paddings, bool ceil_mode, bool exclusive, str data_format, str pooling_type, bool global_pooling, bool adaptive, str padding_algorithm)
Z
zyfncg 已提交
1232 1233
  output : Tensor(x_grad)
  infer_meta :
1234 1235
    func : UnchangedInferMeta
    param: [x]
Z
zyfncg 已提交
1236 1237
  kernel :
    func : pool3d_grad
1238
    param : [x, out, out_grad, kernel_size, strides, paddings, ceil_mode, exclusive, data_format, pooling_type, global_pooling, adaptive, padding_algorithm]
Z
zyfncg 已提交
1239

C
Charles-hit 已提交
1240 1241 1242 1243 1244 1245
- backward_op : pow_double_grad
  forward : pow_grad(Tensor x, Tensor grad_out, Scalar y) -> Tensor(grad_x)
  args : (Tensor x, Tensor grad_out, Tensor grad_x_grad, Scalar y)
  output : Tensor(x_grad), Tensor(grad_out_grad)
  infer_meta :
    func : GeneralBinaryGradInferMeta
C
Charles-hit 已提交
1246
    param: [x, grad_out]
C
Charles-hit 已提交
1247 1248
  kernel :
    func : pow_double_grad
C
Charles-hit 已提交
1249
  backward : pow_triple_grad
C
Charles-hit 已提交
1250 1251
  inplace : (grad_x_grad -> x_grad)

1252
- backward_op : pow_grad
1253 1254
  forward : pow(Tensor x, Scalar y) -> Tensor(out)
  args : (Tensor x, Tensor out_grad, Scalar y=-1)
Z
zyfncg 已提交
1255 1256 1257 1258 1259 1260
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param: [x]
  kernel :
    func : pow_grad
C
Charles-hit 已提交
1261
  backward: pow_double_grad
Z
zyfncg 已提交
1262 1263
  inplace : (out_grad -> x_grad)

C
Charles-hit 已提交
1264 1265 1266 1267 1268 1269 1270 1271 1272 1273
- backward_op : pow_triple_grad
  forward : pow_double_grad(Tensor x, Tensor grad_out, Tensor grad_grad_x, Scalar y) -> Tensor(grad_x), Tensor(grad_grad_out)
  args : (Tensor x, Tensor grad_out, Tensor grad_grad_x, Tensor grad_x_grad, Tensor grad_grad_out_grad, Scalar y)
  output : Tensor(x_grad), Tensor(grad_out_grad), Tensor(grad_grad_x_grad)
  infer_meta :
    func : GeneralTernaryGradInferMeta
    param: [x, grad_out, grad_grad_x]
  kernel :
    func : pow_triple_grad

1274
- backward_op : prelu_grad
Z
zyfncg 已提交
1275 1276 1277 1278 1279 1280 1281 1282 1283
  forward : prelu(Tensor x, Tensor alpha, str data_format, str mode) -> Tensor(out)
  args : (Tensor x, Tensor alpha, Tensor out_grad, str data_format, str mode)
  output : Tensor(x_grad), Tensor(alpha_grad)
  infer_meta :
    func : GeneralBinaryGradInferMeta
    param: [x, alpha]
  kernel :
    func : prelu_grad

1284 1285 1286 1287 1288 1289 1290 1291 1292 1293
- backward_op : prod_grad
  forward : prod (Tensor x, IntArray dims, bool keep_dim, bool reduce_all) -> Tensor(out)
  args : (Tensor x, Tensor out, Tensor out_grad, IntArray dims,  bool keep_dim, bool reduce_all)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : prod_grad

1294
- backward_op : psroi_pool_grad
Z
zyfncg 已提交
1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306
  forward : psroi_pool (Tensor x, Tensor boxes, Tensor boxes_num, int pooled_height, int pooled_width, int output_channels, float spatial_scale) -> Tensor(out)
  args : (Tensor x, Tensor boxes, Tensor boxes_num, Tensor out_grad, int pooled_height, int pooled_width, int output_channels, float spatial_scale)
  output : Tensor(x_grad)
  infer_meta :
    func : GeneralUnaryGradInferMeta
    param : [x]
  kernel :
    func : psroi_pool_grad
    data_type : x
  optional : boxes_num

# output is optional
1307
- backward_op : put_along_axis_grad
1308 1309
  forward : put_along_axis (Tensor arr, Tensor indices, Tensor value, int axis, str reduce) -> Tensor(out)
  args : (Tensor arr, Tensor indices, Tensor out_grad, int axis, str reduce)
1310
  output : Tensor(arr_grad), Tensor(value_grad)
Z
zyfncg 已提交
1311 1312
  infer_meta :
    func : GeneralBinaryGradInferMeta
1313
    param : [arr, indices]
Z
zyfncg 已提交
1314 1315 1316
  kernel :
    func : put_along_axis_grad

1317
- backward_op : qr_grad
Y
Yulong Ao 已提交
1318 1319 1320 1321 1322 1323 1324 1325 1326
  forward : qr (Tensor x, str mode) -> Tensor(q), Tensor(r)
  args : (Tensor x, Tensor q, Tensor r, Tensor q_grad, Tensor r_grad, str mode)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : qr_grad

1327
- backward_op : real_grad
Z
zyfncg 已提交
1328 1329 1330 1331 1332
  forward : real (Tensor x) -> Tensor(out)
  args : (Tensor out_grad)
  output : Tensor(x_grad)
  invoke : real_grad_impl(out_grad, x_grad)

1333
- backward_op : relu6_grad
1334 1335
  forward : relu6 (Tensor x) -> Tensor(out)
  args : (Tensor out, Tensor out_grad, float threshold = 6)
1336 1337 1338 1339 1340 1341 1342 1343
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [out]
  kernel :
    func : relu6_grad
  inplace : (out_grad -> x_grad)

1344
- backward_op : renorm_grad
S
seemingwang 已提交
1345 1346 1347 1348 1349 1350 1351 1352 1353
  forward : renorm (Tensor x, float p, int axis, float max_norm) -> Tensor(out)
  args : (Tensor x, Tensor out_grad, float p, int axis, float max_norm)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [out_grad]
  kernel :
    func : renorm_grad

1354
- backward_op : repeat_interleave_grad
1355 1356
  forward : repeat_interleave(Tensor x, int repeats, int axis) -> Tensor(out)
  args : (Tensor x, Tensor out_grad, int repeats, int axis)
S
seemingwang 已提交
1357 1358 1359 1360 1361 1362 1363
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : repeat_interleave_grad

1364
- backward_op : repeat_interleave_with_tensor_index_grad
1365 1366
  forward : repeat_interleave_with_tensor_index(Tensor x, Tensor repeats, int axis) -> Tensor(out)
  args : (Tensor x, Tensor repeats, Tensor out_grad, int axis)
S
seemingwang 已提交
1367 1368 1369 1370 1371 1372 1373 1374
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : repeat_interleave_with_tensor_index_grad
    data_type : x

1375
- backward_op : reshape_double_grad
Z
zyfncg 已提交
1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386
  forward : reshape_grad (Tensor xshape, Tensor grad_out) -> Tensor(grad_x)
  args : (Tensor grad_out, Tensor grad_x_grad)
  output : Tensor(grad_out_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [grad_out]
  kernel :
    func : reshape_double_grad
  no_need_buffer : grad_out
  inplace : (grad_x_grad -> grad_out_grad)

1387
- backward_op : reshape_grad
Z
zyfncg 已提交
1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402
  forward : reshape (Tensor x, IntArray shape) -> Tensor(out), Tensor(xshape)
  args : (Tensor xshape, Tensor out_grad)
  output : Tensor(x_grad)
  infer_meta :
    func : KernelWithXShapeInferMeta
    param : [xshape]
  kernel :
    func : reshape_grad
    param : [out_grad]
    data_type: out_grad
    backend: out_grad
    layout: out_grad
  backward : reshape_double_grad
  inplace : (out_grad -> x_grad)

1403
- backward_op : reverse_array_grad
1404 1405
  forward : reverse_array (Tensor[] x, IntArray axis) -> Tensor[](out)
  args : (Tensor[] out_grad, IntArray axis)
W
wanghuancoder 已提交
1406 1407 1408 1409 1410 1411
  output : Tensor[](x_grad){out_grad.size()}
  infer_meta :
    func : ReverseArrayInferMeta
  kernel :
    func : reverse

1412
- backward_op : reverse_grad
1413 1414
  forward : reverse (Tensor x, IntArray axis) -> Tensor(out)
  args : (Tensor out_grad, IntArray axis)
W
wanghuancoder 已提交
1415 1416 1417
  output : Tensor(x_grad)
  invoke : reverse(out_grad, axis)

Y
YuanRisheng 已提交
1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429
- backward_op : rnn_grad
  forward : rnn (Tensor x, Tensor[] pre_state, Tensor[] weight_list, Tensor sequence_length, Tensor dropout_state_in, float dropout_prob, bool is_bidirec, int input_size, int hidden_size, int num_layers, str mode, int seed, bool is_test) -> Tensor(out), Tensor(dropout_state_out), Tensor[](state), Tensor(reserve)
  args : (Tensor x, Tensor[] pre_state, Tensor[] weight_list, Tensor sequence_length, Tensor out, Tensor dropout_state_out, Tensor reserve, Tensor out_grad, Tensor[] state_grad, float dropout_prob, bool is_bidirec, int input_size, int hidden_size, int num_layers, str mode, int seed, bool is_test)
  output : Tensor(x_grad), Tensor[](pre_state_grad){pre_state.size()}, Tensor[](weight_list_grad){weight_list.size()}
  infer_meta :
    func : RnnGradInferMeta
    param : [x, pre_state, weight_list]
  kernel :
    func : rnn_grad
    data_type: out_grad
  optional : sequence_length

1430
- backward_op : roi_align_grad
Z
zyfncg 已提交
1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442
  forward : roi_align (Tensor x, Tensor boxes, Tensor boxes_num, int pooled_height, int pooled_width, float spatial_scale, int sampling_ratio, bool aligned) -> Tensor(out)
  args : (Tensor x, Tensor boxes, Tensor boxes_num, Tensor out_grad, int pooled_height, int pooled_width, float spatial_scale, int sampling_ratio, bool aligned)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : roi_align_grad
    data_type : boxes
  no_need_buffer : x
  optional : boxes_num

1443
- backward_op : roi_pool_grad
Z
zyfncg 已提交
1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454
  forward : roi_pool (Tensor x, Tensor boxes, Tensor boxes_num, int pooled_height, int pooled_width, float spatial_scale) -> Tensor(out), Tensor(arg_max)
  args : (Tensor x, Tensor boxes, Tensor boxes_num, Tensor arg_max, Tensor out_grad, int pooled_height, int pooled_width, float spatial_scale)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : roi_pool_grad
    data_type : x
  optional : boxes_num

1455
- backward_op : roll_grad
Z
zyfncg 已提交
1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466
  forward : roll(Tensor x, IntArray shifts, int64_t[] axis) -> Tensor(out)
  args : (Tensor x, Tensor out_grad, IntArray shifts, int64_t[] axis)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : roll_grad
    data_type : x
  no_need_buffer : x

1467
- backward_op : scale_grad
Z
zyfncg 已提交
1468
  forward : scale (Tensor x, Scalar scale, float bias, bool bias_after_scale) -> Tensor(out)
1469
  args : (Tensor out_grad, Scalar scale=1.0, bool bias_after_scale=true)
Z
zyfncg 已提交
1470 1471 1472
  output : Tensor(x_grad)
  invoke : scale(out_grad, scale, 0.0, bias_after_scale)

1473
- backward_op : scatter_grad
Z
zyfncg 已提交
1474 1475 1476 1477 1478 1479 1480 1481 1482 1483
  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
  no_need_buffer : updates

1484
- backward_op : scatter_nd_add_grad
Z
zyfncg 已提交
1485 1486 1487 1488 1489 1490 1491 1492 1493 1494
  forward : scatter_nd_add (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_add_grad
  no_need_buffer : updates

1495
- backward_op : segment_pool_grad
Z
zyfncg 已提交
1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506
  forward : segment_pool (Tensor x, Tensor segment_ids, str pooltype) -> Tensor(out), Tensor(summed_ids)
  args : (Tensor x, Tensor segment_ids, Tensor out, Tensor summed_ids, Tensor out_grad, str pooltype)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : segment_pool_grad
    data_type : x
  optional : summed_ids

1507
- backward_op : selu_grad
Z
zyfncg 已提交
1508 1509 1510 1511 1512 1513 1514 1515 1516
  forward : selu (Tensor x, float scale, float alpha) -> Tensor(out)
  args : (Tensor out, Tensor out_grad, float scale, float alpha)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [out]
  kernel :
    func : selu_grad

1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540
- backward_op : send_u_recv_grad
  forward : send_u_recv (Tensor x, Tensor src_index, Tensor dst_index, str reduce_op = "SUM", IntArray out_size = {0}) -> Tensor(out), Tensor(dst_count)
  args : (Tensor x, Tensor src_index, Tensor dst_index, Tensor out, Tensor dst_count, Tensor out_grad, str reduce_op = "SUM")
  output : Tensor(x_grad)
  infer_meta :
    func : GeneralUnaryGradInferMeta
    param : [x]
  kernel :
    func : send_u_recv_grad
    data_type : out_grad
  optional: out, dst_count

- backward_op : send_ue_recv_grad
  forward : send_ue_recv (Tensor x, Tensor y, Tensor src_index, Tensor dst_index, str message_op, str reduce_op, IntArray out_size) -> Tensor(out), Tensor(dst_count)
  args : (Tensor x, Tensor y, Tensor src_index, Tensor dst_index, Tensor out, Tensor dst_count, Tensor out_grad, str message_op, str reduce_op)
  output : Tensor(x_grad), Tensor(y_grad)
  infer_meta :
    func : GeneralBinaryGradInferMeta
    param : [x, y]
  kernel :
    func : send_ue_recv_grad
    data_type : out_grad
  optional: out, dst_count

1541
- backward_op : sigmoid_cross_entropy_with_logits_grad
Z
zyfncg 已提交
1542 1543 1544 1545 1546 1547 1548 1549 1550 1551
  forward : sigmoid_cross_entropy_with_logits (Tensor x, Tensor label, bool normalize, int ignore_index) -> Tensor(out)
  args : (Tensor x, Tensor label, Tensor out_grad, bool normalize, int ignore_index)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : sigmoid_cross_entropy_with_logits_grad
  inplace : (out_grad -> x_grad)

1552 1553 1554 1555 1556 1557
- backward_op : sign_grad
  forward : sign (Tensor x) -> Tensor(out)
  args : (Tensor out_grad)
  output : Tensor(x_grad)
  invoke : scale(out_grad, 0.0, 0.0, true)

1558
- backward_op : slice_double_grad
1559 1560 1561
  forward : slice_grad (Tensor input, Tensor grad_out, int64_t[] axes, IntArray starts, IntArray ends, int64_t[] infer_flags, int64_t[] decrease_axis) -> Tensor(grad_input)
  args : (Tensor grad_input_grad, int64_t[] axes, IntArray starts, IntArray ends, int64_t[] infer_flags, int64_t[] decrease_axis)
  output : Tensor(grad_out_grad)
1562
  invoke : slice(grad_input_grad, axes, starts, ends, infer_flags, decrease_axis)
1563

1564
- backward_op : slice_grad
Z
zyfncg 已提交
1565 1566 1567 1568 1569 1570 1571 1572
  forward : slice (Tensor input, int64_t[] axes, IntArray starts, IntArray ends, int64_t[] infer_flags, int64_t[] decrease_axis) -> Tensor(out)
  args : (Tensor input, Tensor out_grad, int64_t[] axes, IntArray starts, IntArray ends, int64_t[] infer_flags, int64_t[] decrease_axis)
  output : Tensor(input_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [input]
  kernel :
    func : slice_grad
1573
  backward : slice_double_grad
Z
zyfncg 已提交
1574 1575
  no_need_buffer : input

1576
- backward_op : slogdet_grad
1577 1578 1579 1580 1581 1582 1583 1584 1585
  forward : slogdet (Tensor x) -> Tensor(out)
  args : (Tensor x, Tensor out, Tensor out_grad)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : slogdeterminant_grad

1586
- backward_op : softmax_grad
Z
zyfncg 已提交
1587 1588 1589 1590 1591 1592 1593 1594 1595
  forward : softmax (Tensor x, int axis) -> Tensor(out)
  args : (Tensor out, Tensor out_grad, int axis)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [out]
  kernel :
    func : softmax_grad

1596
- backward_op : spectral_norm_grad
1597 1598 1599 1600 1601 1602 1603 1604 1605
  forward : spectral_norm (Tensor weight, Tensor u, Tensor v, int dim, int power_iters, float eps) -> Tensor(out)
  args : (Tensor weight, Tensor u, Tensor v, Tensor out_grad, int dim, int power_iters, float eps)
  output : Tensor(weight_grad)
  infer_meta :
    func : SpectralNormGradInferMeta
  kernel :
    func : spectral_norm_grad
    data_type : out_grad

1606
- backward_op : split_grad
Z
zyfncg 已提交
1607 1608 1609 1610
  forward : split (Tensor x, IntArray num_or_sections, Scalar axis) -> Tensor[](out)
  args : (Tensor[] out_grad, Scalar axis = -1)
  output : Tensor(x_grad)
  invoke : concat( out_grad, axis)
C
Charles-hit 已提交
1611

1612
- backward_op : split_with_num_grad
C
Charles-hit 已提交
1613 1614 1615 1616
  forward : split_with_num (Tensor x, int num, Scalar axis) -> Tensor[](out)
  args : (Tensor[] out_grad, Scalar axis = -1)
  output : Tensor(x_grad)
  invoke : concat( out_grad, axis)
Z
zyfncg 已提交
1617

1618
- backward_op : squared_l2_norm_grad
1619 1620 1621 1622 1623 1624 1625 1626 1627
  forward : squared_l2_norm(Tensor x) -> Tensor(out)
  args : (Tensor x, Tensor out_grad)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param: [x]
  kernel :
    func : squared_l2_norm_grad

1628
- backward_op : squeeze_double_grad
1629 1630
  forward : squeeze_grad(Tensor xshape, Tensor grad_out, IntArray axis) -> Tensor(grad_x)
  args : (Tensor grad_x_grad, IntArray axis)
Z
zyfncg 已提交
1631
  output : Tensor(grad_out_grad)
1632
  invoke: squeeze(grad_x_grad, axis)
Z
zyfncg 已提交
1633

1634
- backward_op : squeeze_grad
1635 1636
  forward : squeeze(Tensor x, IntArray axis) -> Tensor(out), Tensor(xshape)
  args : (Tensor xshape, Tensor out_grad, IntArray axis)
Z
zyfncg 已提交
1637 1638 1639 1640 1641 1642 1643 1644 1645
  output : Tensor(x_grad)
  infer_meta :
    func : KernelWithXShapeInferMeta
    param: [xshape]
  kernel :
    func : squeeze_grad
  inplace : (out_grad -> x_grad)
  backward: squeeze_double_grad

1646
- backward_op : stack_grad
Z
zyfncg 已提交
1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657
  forward : stack (Tensor[] x, int axis) -> Tensor(out)
  args : (Tensor[] x, Tensor out_grad, int axis)
  output : Tensor[](x_grad){x.size()}
  infer_meta :
    func : StackGradInferMeta
    param: [out_grad, axis]
  kernel :
    func : stack_grad
    param : [out_grad, axis]
  no_need_buffer : x

1658
- backward_op : strided_slice_grad
Z
zyfncg 已提交
1659 1660 1661 1662 1663 1664 1665 1666 1667 1668
  forward : strided_slice (Tensor x, int[] axes, IntArray starts, IntArray ends, IntArray strides) -> Tensor(out)
  args : (Tensor x, Tensor out_grad, int[] axes, IntArray starts, IntArray ends, IntArray strides)
  output : Tensor(x_grad)
  infer_meta :
    func : GeneralUnaryGradInferMeta
    param : [x]
  kernel :
    func : strided_slice_grad
  no_need_buffer : x

1669
- backward_op : subtract_double_grad
Z
zyfncg 已提交
1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681
  forward : subtract_grad (Tensor x, Tensor y, Tensor grad_out, int axis = -1) -> Tensor(grad_x), Tensor(grad_y)
  args : (Tensor y, Tensor grad_out, Tensor grad_x_grad, Tensor grad_y_grad, int axis = -1)
  output : Tensor(grad_out_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [grad_out]
  kernel :
    func : subtract_double_grad
  optional : grad_x_grad, grad_y_grad
  no_need_buffer : y, grad_out
  inplace : (grad_x_grad -> grad_out_grad)

1682
- backward_op : subtract_grad
Z
zyfncg 已提交
1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694
  forward : subtract (Tensor x, Tensor y) -> Tensor(out)
  args : (Tensor x, Tensor y, Tensor out_grad, int axis = -1)
  output : Tensor(x_grad), Tensor(y_grad)
  infer_meta :
    func : GeneralBinaryGradInferMeta
    param : [x, y]
  kernel :
    func : subtract_grad
  no_need_buffer : x, y
  backward : subtract_double_grad
  inplace : (out_grad -> x_grad)

1695
- backward_op : sum_double_grad
1696 1697
  forward : sum_grad (Tensor x, Tensor grad_out, IntArray axis, bool keepdim, bool reduce_all=false) -> Tensor(grad_x)
  args : (Tensor grad_x_grad, IntArray axis={}, bool keepdim=false)
Z
zyfncg 已提交
1698
  output : Tensor(grad_out_grad)
1699
  invoke : sum(grad_x_grad, axis, grad_x_grad.dtype(), keepdim)
Z
zyfncg 已提交
1700

1701
- backward_op : sum_grad
1702 1703
  forward : sum (Tensor x, IntArray axis={}, DataType dtype=DataType::UNDEFINED, bool keepdim=false) -> Tensor(out)
  args : (Tensor x, Tensor out_grad, IntArray axis, bool keepdim, bool reduce_all=false)
Z
zyfncg 已提交
1704 1705 1706 1707 1708 1709 1710 1711 1712
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : sum_grad
  no_need_buffer : x
  backward : sum_double_grad

1713
- backward_op : svd_grad
1714 1715
  forward : svd (Tensor x, bool full_matrices) -> Tensor(u), Tensor(s), Tensor(vh)
  args : (Tensor x, Tensor u, Tensor vh, Tensor s, Tensor u_grad, Tensor vh_grad, Tensor s_grad, bool full_matrices)
1716 1717 1718 1719 1720 1721 1722 1723
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : svd_grad
  optional: u_grad, vh_grad, s_grad

1724
- backward_op : swish_grad
1725
  forward : swish (Tensor x) -> Tensor(out)
Z
zyfncg 已提交
1726 1727 1728 1729 1730 1731 1732 1733 1734
  args : (Tensor x, Tensor out_grad, float bete=1.0)
  output : Tensor(x_grad)
  infer_meta :
    func : GeneralUnaryGradInferMeta
    param : [x]
  kernel :
    func : swish_grad
  inplace : (out_grad -> x_grad)

1735
- backward_op : sync_batch_norm_grad
1736 1737
  forward : sync_batch_norm_ (Tensor x, Tensor mean, Tensor variance, Tensor scale, Tensor bias, bool is_test, float momentum, float epsilon, str data_layout, bool use_global_stats, bool trainable_statistics) -> Tensor(out), Tensor(mean_out), Tensor(variance_out), Tensor(saved_mean), Tensor(saved_variance), Tensor(reserve_space)
  args : (Tensor x, Tensor scale, Tensor bias, Tensor saved_mean, Tensor saved_variance, Tensor reserve_space, Tensor out_grad, float momentum, float epsilon, str data_layout, bool is_test, bool use_global_stats, bool trainable_statistics)
1738 1739 1740 1741 1742 1743 1744
  output : Tensor(x_grad), Tensor(scale_grad), Tensor(bias_grad)
  infer_meta :
    func : GeneralTernaryGradInferMeta
    param : [x, scale, bias]
  kernel :
    func : sync_batch_norm_grad
    data_type : out_grad
1745
  optional : reserve_space
1746

1747
- backward_op : take_along_axis_grad
1748 1749 1750
  forward : take_along_axis (Tensor arr, Tensor indices, int axis) -> Tensor(out)
  args : (Tensor arr, Tensor indices, Tensor out_grad, int axis)
  output : Tensor(arr_grad)
Z
zyfncg 已提交
1751 1752
  infer_meta :
    func : UnchangedInferMeta
1753
    param : [arr]
Z
zyfncg 已提交
1754 1755 1756
  kernel :
    func : take_along_axis_grad

1757
- backward_op : temporal_shift_grad
C
ccrrong 已提交
1758 1759 1760 1761 1762 1763 1764 1765 1766
  forward : temporal_shift(Tensor x, int seg_num, float shift_ratio, str data_format_str) -> Tensor(out)
  args : (Tensor out_grad, int seg_num, float shift_ratio, str data_format_str)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [out_grad]
  kernel :
    func : temporal_shift_grad

1767
- backward_op : tile_double_grad
Z
zyfncg 已提交
1768 1769 1770
  forward : tile_grad (Tensor x, Tensor grad_out, IntArray repeat_times) -> Tensor(grad_x)
  args : (Tensor grad_x_grad, IntArray repeat_times)
  output : Tensor(grad_out_grad)
1771
  invoke : tile(grad_x_grad, repeat_times)
Z
zyfncg 已提交
1772

1773
- backward_op : tile_grad
Z
zyfncg 已提交
1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784
  forward : tile (Tensor x, IntArray repeat_times) -> Tensor(out)
  args : (Tensor x, Tensor out_grad, IntArray repeat_times)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : tile_grad
  no_need_buffer : x
  backward : tile_double_grad

1785 1786
- backward_op : topk_grad
  forward : topk (Tensor x, Scalar k, int axis = -1, bool largest = true, bool sorted = true) -> Tensor(out), Tensor(indices)
Z
zyfncg 已提交
1787 1788 1789 1790 1791 1792 1793 1794
  args : (Tensor x, Tensor indices, Tensor out_grad, Scalar k = -1, int axis = -1, bool largest = true, bool sorted = true)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : top_k_grad

1795
- backward_op : transpose_double_grad
1796 1797
  forward : transpose_grad (Tensor grad_out, int[] perm) -> Tensor(grad_x)
  args : (Tensor grad_x_grad, int[] perm)
Z
zyfncg 已提交
1798
  output : Tensor(grad_out_grad)
1799
  invoke : transpose(grad_x_grad, perm)
Z
zyfncg 已提交
1800

1801
- backward_op : transpose_grad
1802 1803
  forward : transpose (Tensor x, int[] perm) -> Tensor(out)
  args : (Tensor out_grad, int[] perm)
Z
zyfncg 已提交
1804 1805 1806
  output : Tensor(x_grad)
  infer_meta :
    func : TransposeGradInferMeta
1807
    param : [out_grad, perm]
Z
zyfncg 已提交
1808 1809 1810 1811
  kernel :
    func : transpose_grad
  backward : transpose_double_grad

1812
- backward_op : triangular_solve_grad
Z
zyfncg 已提交
1813 1814 1815 1816 1817 1818 1819 1820 1821
  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

1822
- backward_op : tril_grad
1823 1824
  forward : tril(Tensor x,  int diagonal) -> Tensor(out)
  args : (Tensor out_grad,  int diagonal)
Z
zyfncg 已提交
1825 1826 1827 1828 1829
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [out_grad]
  kernel :
1830
    func : tril_grad
Z
zyfncg 已提交
1831

1832
- backward_op : trilinear_interp_grad
1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843
  forward : trilinear_interp (Tensor x, Tensor out_size, Tensor[] size_tensor, Tensor scale_tensor, str data_layout, int out_d, int out_h, int out_w, float[] scale, str interp_method, bool align_corners, int align_mode) -> Tensor(output)
  args : (Tensor x, Tensor out_size, Tensor[] size_tensor, Tensor scale_tensor, Tensor output_grad, str data_layout, int out_d, int out_h, int out_w, float[] scale, str interp_method, bool align_corners, int align_mode)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param: [x]
  optional: out_size, size_tensor, scale_tensor
  kernel :
    func : trilinear_interp_grad
    data_type : output_grad

1844 1845 1846 1847 1848 1849 1850 1851 1852 1853
- backward_op : triu_grad
  forward : triu(Tensor x,  int diagonal) -> Tensor(out)
  args : (Tensor out_grad,  int diagonal)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [out_grad]
  kernel :
    func : triu_grad

1854
- backward_op : unbind_grad
Z
zyfncg 已提交
1855 1856 1857 1858 1859
  forward : unbind (Tensor input, int axis) -> Tensor[](out)
  args : (Tensor[] out_grad, int axis)
  output : Tensor(input_grad)
  invoke : stack(out_grad, axis)

1860 1861
- backward_op : uniform_inplace_grad
  forward : uniform_inplace(Tensor x, float min, float max, int seed, int diag_num, int diag_step, float diag_val) -> Tensor(out)
1862 1863 1864 1865 1866
  args : (Tensor out_grad, float min, float max, int seed, int diag_num, int diag_step, float diag_val)
  output : Tensor(x_grad)
  infer_meta :
    func : UniformRandomInplaceGradInferMeta
  kernel :
1867
    func : uniform_inplace_grad
1868 1869
  inplace : (out_grad -> x_grad)

1870
- backward_op : unsqueeze_double_grad
Z
zyfncg 已提交
1871 1872 1873 1874 1875
  forward : unsqueeze_grad(Tensor xshape, Tensor grad_out, IntArray axes) -> Tensor(grad_x)
  args : (Tensor grad_x_grad, IntArray axes)
  output : Tensor(grad_out_grad)
  invoke : unsqueeze(grad_x_grad, axes)

1876
- backward_op : unsqueeze_grad
Z
zyfncg 已提交
1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888
  forward : unsqueeze(Tensor x, IntArray axes) -> Tensor(out), Tensor(xshape)
  args : (Tensor xshape, Tensor out_grad, IntArray axes)
  output : Tensor(x_grad)
  infer_meta :
    func : KernelWithXShapeInferMeta
    param: [xshape]
  kernel :
    func : unsqueeze_grad
    param: [xshape, out_grad]
  inplace : (out_grad -> x_grad)
  backward : unsqueeze_double_grad

1889
- backward_op : unstack_grad
1890 1891 1892 1893 1894 1895 1896 1897 1898
  forward : unstack (Tensor x, int axis, int num) -> Tensor[](out)
  args : (Tensor[] out_grad, int axis)
  output : Tensor(x_grad)
  infer_meta :
    func : UnStackGradInferMeta
    param : [out_grad, axis]
  kernel :
    func : unstack_grad

1899
- backward_op : warpctc_grad
1900
  forward : warpctc (Tensor logits, Tensor label, Tensor logits_length, Tensor labels_length, int blank, bool norm_by_times) -> Tensor(loss), Tensor(warpctcgrad)
Z
Zhong Hui 已提交
1901 1902 1903 1904 1905 1906 1907 1908 1909 1910
  args : (Tensor logits, Tensor logits_length, Tensor warpctcgrad, Tensor loss_grad, int blank, bool norm_by_times)
  output : Tensor(logits_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [logits]
  kernel :
    func : warpctc_grad
  optional : logits_length
  no_need_buffer : logits

1911
- backward_op : where_grad
Z
zyfncg 已提交
1912 1913 1914 1915 1916 1917 1918 1919 1920
  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
  no_need_buffer : x, y
1921

1922 1923
- backward_op : yolo_loss_grad
  forward : yolo_loss(Tensor x, Tensor gt_box, Tensor gt_label, Tensor gt_score, int[] anchors, int[] anchor_mask, int class_num, float ignore_thresh, int downsample_ratio, bool use_label_smooth=true, float scale_x_y=1.0) -> Tensor(loss), Tensor(objectness_mask), Tensor(gt_match_mask)
1924 1925 1926
  args : (Tensor x, Tensor gt_box, Tensor gt_label, Tensor gt_score, Tensor objectness_mask, Tensor gt_match_mask, Tensor loss_grad, int[] anchors, int[] anchor_mask, int class_num, float ignore_thresh, int downsample_ratio, bool use_label_smooth=true, float scale_x_y=1.0)
  output : Tensor(x_grad), Tensor(gt_box_grad), Tensor(gt_label_grad), Tensor(gt_score_grad)
  infer_meta :
1927
    func : YoloLossGradInferMeta
1928
  kernel :
1929
    func : yolo_loss_grad
1930
  optional : gt_score
X
xiaoting 已提交
1931

1932
- backward_op: unpool3d_grad
X
xiaoting 已提交
1933 1934 1935 1936 1937 1938 1939 1940 1941 1942
  forward: unpool3d (Tensor x, Tensor indices, int[] ksize, int[] strides, int[] padding, int[] output_size, str data_format) -> Tensor(out)
  args: (Tensor x, Tensor indices, Tensor out, Tensor out_grad, int[] ksize, int[] strides, int[] padding, int[] output_size, str data_format)
  output: Tensor(x_grad)
  infer_meta:
    func: UnchangedInferMeta
    param : [x]
  kernel:
    func: unpool3d_grad
    data_type: x

1943
- backward_op: unpool_grad
1944 1945
  forward: unpool (Tensor x, Tensor indices, int[] ksize, int[] strides, int[] padding,  IntArray output_size, str data_format) -> Tensor(out)
  args: (Tensor x, Tensor indices, Tensor out, Tensor out_grad, int[] ksize, int[] strides, int[] padding, IntArray output_size, str data_format)
X
xiaoting 已提交
1946 1947 1948 1949 1950 1951 1952
  output: Tensor(x_grad)
  infer_meta:
    func: UnchangedInferMeta
    param : [x]
  kernel:
    func: unpool_grad
    data_type: x