legacy_backward.yaml 95.9 KB
Newer Older
1
- backward_op : abs_double_grad
Z
zyfncg 已提交
2 3 4 5 6 7 8 9 10 11 12
  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
  data_transform:
    skip_transform : grad_x_grad

13
- backward_op : abs_grad
Z
zyfncg 已提交
14 15 16 17 18 19 20 21 22 23 24 25
  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
  data_transform:
    skip_transform : out_grad
  backward : abs_double_grad

26
- backward_op : acos_grad
Z
zyfncg 已提交
27 28 29 30 31 32 33 34 35 36
  forward : acos (Tensor x) -> Tensor(out)
  args : (Tensor x, Tensor out_grad)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : acos_grad
  inplace : (out_grad -> x_grad)

37
- backward_op : acosh_grad
Z
zyfncg 已提交
38 39 40 41 42 43 44 45 46 47
  forward : acosh (Tensor x) -> Tensor(out)
  args : (Tensor x, Tensor out_grad)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : acosh_grad
  inplace : (out_grad -> x_grad)

48
- backward_op : add_double_grad
Z
zyfncg 已提交
49 50 51 52 53 54 55 56 57 58 59 60
  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)

61
- backward_op : add_grad
Z
zyfncg 已提交
62 63 64 65 66 67 68 69 70 71 72 73
  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)

74
- backward_op : add_triple_grad
Z
zyfncg 已提交
75 76 77 78 79 80 81 82 83 84
  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)

85
- backward_op : addmm_grad
Z
zyfncg 已提交
86 87 88 89 90 91 92 93 94
  forward : addmm (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

95
- backward_op : affine_grid_grad
96 97 98 99 100 101 102 103 104 105 106
  forward : affine_grid (Tensor input, IntArray outputShape, bool use_cudnn=true, bool align_corners=true) -> Tensor(output)
  args : (Tensor output_grad, IntArray outputShape, bool use_cudnn=true, bool align_corners=true)
  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]
    use_gpudnn: use_cudnn

107
- backward_op : amax_grad
108 109 110 111 112 113 114 115 116
  forward: amax (Tensor x,  int64_t[] dims={},  bool keep_dim=false) -> Tensor(out)
  args : (Tensor x, Tensor out, Tensor out_grad, int64_t[] dims={},  bool keep_dim=false, bool reduce_all=false)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param: [x]
  kernel :
    func : amax_grad

117
- backward_op : amin_grad
118 119 120 121 122 123 124 125 126
  forward: amin (Tensor x,  int64_t[] dims={},  bool keep_dim=false) -> Tensor(out)
  args : (Tensor x, Tensor out, Tensor out_grad, int64_t[] dims={},  bool keep_dim=false, bool reduce_all=false)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param: [x]
  kernel :
    func : amin_grad

127
- backward_op : angle_grad
W
WangZhen 已提交
128 129 130 131 132 133 134 135 136 137 138
  forward : angle (Tensor x) -> Tensor(out)
  args : (Tensor x, Tensor out_grad)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : angle_grad
  data_transform:
    skip_transform : out_grad

139
- backward_op : argsort_grad
Z
zyfncg 已提交
140 141 142 143 144 145 146 147
  forward : argsort (Tensor x, int axis, bool descending) -> Tensor(out), Tensor(indices)
  args : (Tensor indices, Tensor x, Tensor out_grad, int axis, bool descending)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : argsort_grad
148
    data_type : out_grad
Z
zyfncg 已提交
149 150
  no_need_buffer : x

151
- backward_op : as_complex_grad
152 153 154 155 156
  forward : as_complex (Tensor x) -> Tensor(out)
  args : (Tensor out_grad)
  output : Tensor(x_grad)
  invoke : as_real(out_grad)

157
- backward_op : as_real_grad
158 159 160 161 162
  forward : as_real (Tensor x) -> Tensor(out)
  args : (Tensor out_grad)
  output : Tensor(x_grad)
  invoke : as_complex(out_grad)

163
- backward_op : asin_grad
Z
zyfncg 已提交
164 165 166 167 168 169 170 171 172 173
  forward : asin (Tensor x) -> Tensor(out)
  args : (Tensor x, Tensor out_grad)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : asin_grad
  inplace : (out_grad -> x_grad)

174
- backward_op : asinh_grad
Z
zyfncg 已提交
175 176 177 178 179 180 181 182 183 184
  forward : asinh (Tensor x) -> Tensor(out)
  args : (Tensor x, Tensor out_grad)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : asinh_grad
  inplace : (out_grad -> x_grad)

185
- backward_op : assign_grad
Z
zyfncg 已提交
186 187 188
  forward : assign (Tensor x) -> Tensor(out)
  args : (Tensor out_grad)
  output : Tensor(x_grad)
189
  invoke : assign(out_grad)
Z
zyfncg 已提交
190

191
- backward_op : assign_out__grad
Z
zyfncg 已提交
192 193 194 195 196 197 198 199 200
  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)

201
- backward_op : atan_grad
Z
zyfncg 已提交
202 203 204 205 206 207 208 209 210 211
  forward : atan (Tensor x) -> Tensor(out)
  args : (Tensor x, Tensor out_grad)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : atan_grad
  inplace : (out_grad -> x_grad)

212
- backward_op : atanh_grad
Z
zyfncg 已提交
213 214 215 216 217 218 219 220 221 222
  forward : atanh (Tensor x) -> Tensor(out)
  args : (Tensor x, Tensor out_grad)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : atanh_grad
  inplace : (out_grad -> x_grad)

223
- backward_op : batch_norm_double_grad
Z
zyfncg 已提交
224 225 226 227 228 229 230 231 232 233 234 235
  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, bool fuse_with_relu) -> 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, bool fuse_with_relu)
  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)

236
- backward_op : batch_norm_grad
Z
zyfncg 已提交
237 238 239 240 241 242 243 244 245 246 247 248
  forward : batch_norm (Tensor x, Tensor scale, Tensor bias, Tensor mean, Tensor variance, float momentum, float epsilon, str data_layout, bool is_test, bool use_global_stats, bool trainable_statistics, bool fuse_with_relu) -> 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, bool fuse_with_relu)
  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

249
- backward_op : bce_loss_grad
Z
zyfncg 已提交
250 251 252 253 254 255 256 257 258 259
  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)

260
- backward_op : bicubic_interp_grad
261 262 263 264 265 266 267 268 269 270 271
  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

272
- backward_op : bilinear_interp_grad
273 274 275 276 277 278 279 280 281 282 283
  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

284
- backward_op : bilinear_tensor_product_grad
285 286 287 288 289 290 291 292
  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

293
- backward_op : bmm_grad
294 295 296 297 298 299 300 301
  forward : bmm (Tensor x, Tensor y) -> Tensor(out)
  args : (Tensor x, Tensor y, Tensor out_grad)
  output : Tensor(x_grad), Tensor(y_grad)
  infer_meta :
    func : BmmGradInferMeta
  kernel :
    func : bmm_grad

302
- backward_op : brelu_grad
Z
zyfncg 已提交
303 304 305 306 307 308 309 310 311 312
  forward : brelu (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 : brelu_grad
  inplace : (out_grad -> x_grad)

313
- backward_op : broadcast_tensors_grad
314 315 316 317 318 319 320 321 322 323 324
  forward : broadcast_tensors (Tensor[] x) -> Tensor[](out)
  args : (Tensor[] x, Tensor[] out_grad)
  output : Tensor[](x_grad)
  infer_meta :
    func : UnchangedMultiInferMeta
    param : [x]
  kernel :
    func : broadcast_tensors_grad
    param : [out_grad]
  no_need_buffer : x

325
- backward_op : cast_grad
Z
zyfncg 已提交
326 327 328 329 330 331 332 333 334 335 336
  forward : cast (Tensor x, DataType out_dtype) -> Tensor(out)
  args : (Tensor x, Tensor out_grad)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : cast_grad
    data_type : out_grad
  no_need_buffer : x

337
- backward_op : ceil_grad
Z
zyfncg 已提交
338 339 340 341 342 343 344 345 346 347
  forward : ceil(Tensor x) -> Tensor(out)
  args : (Tensor out_grad)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param: [out_grad]
  kernel :
    func : ceil_grad
  inplace : (out_grad -> x_grad)

348
- backward_op : celu_double_grad
Z
zyfncg 已提交
349 350 351 352 353 354 355 356 357 358
  forward : celu_grad(Tensor x, Tensor grad_out, float alpha) -> Tensor(grad_x)
  args : (Tensor x, Tensor grad_out, Tensor grad_x_grad, float alpha)
  output : Tensor(x_grad), Tensor(grad_out_grad)
  infer_meta :
    func : GeneralBinaryGradInferMeta
    param : [x, x]
  kernel :
    func : celu_double_grad
  inplace : (grad_x_grad -> grad_out_grad)

359
- backward_op : celu_grad
Z
zyfncg 已提交
360 361 362 363 364 365 366 367 368 369 370
  forward : celu(Tensor x, float alpha) -> Tensor(out)
  args : (Tensor x, Tensor out_grad, float alpha)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param: [x]
  kernel :
    func : celu_grad
  backward : celu_double_grad
  inplace : (out_grad -> x_grad)

371
- backward_op : clip_double_grad
Z
zyfncg 已提交
372 373 374 375 376 377 378 379 380
  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

381
- backward_op : clip_grad
Z
zyfncg 已提交
382 383 384 385 386 387 388 389 390 391 392
  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)

393
- backward_op : complex_grad
394 395 396 397 398 399 400 401 402
  forward : complex (Tensor x, Tensor y) -> Tensor(out)
  args : (Tensor x, Tensor y, Tensor out_grad)
  output : Tensor(x_grad), Tensor(y_grad)
  infer_meta :
    func : ComplexGradInferMeta
  kernel :
    func : complex_grad
    data_type : x

403
- backward_op : concat_double_grad
Z
zyfncg 已提交
404 405 406 407 408 409 410 411 412
  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)
  infer_meta :
    func : ConcatInferMeta
    param : [grad_x_grad, axis]
  kernel :
    func : concat

413
- backward_op : concat_grad
Z
zyfncg 已提交
414 415 416 417 418 419 420 421 422 423 424
  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

425
- backward_op : conj_grad
Z
zyfncg 已提交
426 427 428 429 430 431 432 433 434
  forward : conj (Tensor x) -> Tensor(out)
  args : (Tensor out_grad)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param: [out_grad]
  kernel :
    func : conj

435
- backward_op : conv2d_grad
Z
zyfncg 已提交
436 437 438
  forward : conv2d (Tensor input, Tensor filter, int[] strides, int[] paddings, str paddding_algorithm, int groups, int[] dilations, str data_format, bool use_addto, int workspace_size_MB, bool exhaustive_search) -> Tensor(out)
  args : (Tensor input, Tensor filter, Tensor out_grad,  int[] strides, int[] paddings, str paddding_algorithm, int groups, int[] dilations, str data_format, bool use_addto, int workspace_size_MB, bool exhaustive_search)
  output : Tensor(input_grad), Tensor(filter_grad)
Z
zyfncg 已提交
439 440 441 442 443 444
  infer_meta :
    func : GeneralBinaryGradInferMeta
    param : [input, filter]
  kernel :
    func : conv2d_grad
    use_gpudnn : true
Z
zyfncg 已提交
445 446
  backward : conv2d_grad_grad

447
- backward_op : conv2d_grad_grad
Z
zyfncg 已提交
448 449 450 451 452 453 454 455 456 457 458
  forward : conv2d_grad (Tensor input, Tensor filter, Tensor grad_out,  int[] strides, int[] paddings, str paddding_algorithm, int groups, int[] dilations, str data_format, bool use_addto, int workspace_size_MB, bool exhaustive_search) -> 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 paddding_algorithm, int groups, int[] dilations, str data_format, bool use_addto, int workspace_size_MB, bool exhaustive_search)
  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
    use_gpudnn : true
  optional : grad_input_grad, grad_filter_grad

459
- backward_op : conv2d_transpose_double_grad
460 461
  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 已提交
462 463 464 465 466 467 468
  output : Tensor(x_grad), Tensor(filter_grad), Tensor(grad_out_grad)
  infer_meta :
    func : Conv2dTransposeDoubleGradInferMeta
  kernel :
    func : conv2d_transpose_grad_grad
    use_gpudnn : true

469
- backward_op : conv2d_transpose_grad
470 471
  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 已提交
472 473
  output : Tensor(x_grad), Tensor(filter_grad)
  infer_meta :
474
    func : Conv2dTransposeGradInferMeta
Z
zyfncg 已提交
475 476 477 478 479
  kernel :
    func : conv2d_transpose_grad
    use_gpudnn : true
  backward : conv2d_transpose_double_grad

480
- backward_op : conv3d_grad
Z
zyfncg 已提交
481 482 483
  forward : conv3d (Tensor input, Tensor filter, int[] strides, int[] paddings, str paddding_algorithm, int groups, int[] dilations, str data_format, bool use_addto, int workspace_size_MB, bool exhaustive_search) -> Tensor(out)
  args : (Tensor input, Tensor filter, Tensor out_grad,  int[] strides, int[] paddings, str paddding_algorithm, int groups, int[] dilations, str data_format, bool use_addto, int workspace_size_MB, bool exhaustive_search)
  output : Tensor(input_grad), Tensor(filter_grad)
Z
zyfncg 已提交
484 485 486 487 488 489
  infer_meta :
    func : GeneralBinaryGradInferMeta
    param : [input, filter]
  kernel :
    func : conv3d_grad
    use_gpudnn : true
Z
zyfncg 已提交
490 491
  backward : conv3d_grad_grad

492
- backward_op : conv3d_grad_grad
Z
zyfncg 已提交
493 494 495 496 497 498 499 500 501 502 503
  forward : conv3d_grad (Tensor input, Tensor filter, Tensor grad_out,  int[] strides, int[] paddings, str paddding_algorithm, int groups, int[] dilations, str data_format, bool use_addto, int workspace_size_MB, bool exhaustive_search) -> 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 paddding_algorithm, int groups, int[] dilations, str data_format, bool use_addto, int workspace_size_MB, bool exhaustive_search)
  output : Tensor(input_grad), Tensor(filter_grad), Tensor(grad_out_grad)
  infer_meta :
    func : GeneralTernaryGradInferMeta
    param: [input, filter, grad_out]
  kernel :
    func : conv3d_grad_grad
    use_gpudnn : true
  optional : grad_input_grad, grad_filter_grad

504
- backward_op : conv3d_transpose_grad
Z
zyfncg 已提交
505 506 507 508 509 510 511 512 513
  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
    use_gpudnn : true

514
- backward_op : cos_grad
Z
zyfncg 已提交
515 516 517 518 519 520 521 522 523 524
  forward : cos (Tensor x) -> Tensor(out)
  args : (Tensor x, Tensor out_grad)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : cos_grad
  inplace : (out_grad -> x_grad)

525
- backward_op : cosh_grad
Z
zyfncg 已提交
526 527 528 529 530 531 532 533 534 535
  forward : cosh (Tensor x) -> Tensor(out)
  args : (Tensor x, Tensor out_grad)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : cosh_grad
  inplace : (out_grad -> x_grad)

536
- backward_op : crop_tensor_grad
537 538 539 540 541 542 543 544 545
  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 :
    func : CropTensorGradInferMeta
  kernel :
    func : crop_tensor_grad
    data_type : x

546
- backward_op : cross_entropy_with_softmax_grad
Z
zyfncg 已提交
547 548 549 550 551 552 553 554 555 556
  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)

557
- backward_op : cumprod_grad
Z
zyfncg 已提交
558 559 560 561 562 563 564 565 566
  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

567
- backward_op : cumsum_grad
W
WangZhen 已提交
568 569
  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 已提交
570 571 572
  output : Tensor(x_grad)
  invoke : cumsum(out_grad, axis, flatten, exclusive, !reverse)

573
- backward_op : deformable_conv_grad
Z
zyfncg 已提交
574 575 576 577 578 579 580 581 582 583
  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

584
- backward_op : depthwise_conv2d_grad
Z
zyfncg 已提交
585 586 587 588 589 590 591 592 593 594 595 596
  forward : depthwise_conv2d (Tensor input, Tensor filter, int[] strides, int[] paddings, str paddding_algorithm, int groups, int[] dilations, str data_format, bool use_addto, int workspace_size_MB, bool exhaustive_search, bool fuse_relu, bool use_gpudnn) -> Tensor(out)
  args : (Tensor input, Tensor filter, Tensor out_grad, int[] strides, int[] paddings, str paddding_algorithm, int groups, int[] dilations, str data_format, bool use_addto, int workspace_size_MB, bool exhaustive_search, bool fuse_relu, bool use_gpudnn)
  output : Tensor(input_grad), Tensor(filter_grad)
  infer_meta :
    func : GeneralBinaryGradInferMeta
    param : [input, filter]
  kernel :
    func : depthwise_conv2d_grad
    param : [input, filter, out_grad, strides, paddings, paddding_algorithm, groups, dilations, data_format, use_addto, workspace_size_MB, exhaustive_search, fuse_relu]
    use_gpudnn : use_gpudnn
  backward : depthwise_conv2d_grad_grad

597
- backward_op : depthwise_conv2d_grad_grad
Z
zyfncg 已提交
598 599 600 601 602 603 604 605 606 607
  forward : depthwise_conv2d_grad (Tensor input, Tensor filter, Tensor grad_out, int[] strides, int[] paddings, str paddding_algorithm, int groups, int[] dilations, str data_format, bool use_addto, int workspace_size_MB, bool exhaustive_search, bool fuse_relu, bool use_gpudnn) -> 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 paddding_algorithm, int groups, int[] dilations, str data_format, bool use_addto, int workspace_size_MB, bool exhaustive_search, bool fuse_relu)
  output : Tensor(input_grad), Tensor(filter_grad), Tensor(grad_out_grad)
  infer_meta :
    func : GeneralTernaryGradInferMeta
    param: [input, filter, grad_out]
  kernel :
    func : depthwise_conv2d_grad_grad
  optional : grad_input_grad, grad_filter_grad

608
- backward_op : depthwise_conv2d_transpose_grad
609 610
  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 已提交
611 612
  output : Tensor(x_grad), Tensor(filter_grad)
  infer_meta :
613
    func : Conv2dTransposeGradInferMeta
Z
zyfncg 已提交
614 615 616
  kernel :
    func : depthwise_conv2d_transpose_grad

617
- backward_op : det_grad
Z
zyfncg 已提交
618 619 620 621 622 623 624 625 626
  forward : det (Tensor x) -> Tensor(out)
  args : (Tensor x, Tensor out, Tensor out_grad)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : determinant_grad

627
- backward_op : divide_double_grad
Z
zyfncg 已提交
628 629 630 631 632 633 634 635 636 637 638 639
  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)

640
- backward_op : divide_grad
Z
zyfncg 已提交
641 642 643 644 645 646 647 648 649 650
  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

651
- backward_op : dropout_grad
652 653
  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 已提交
654 655 656 657 658 659 660
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [out_grad]
  kernel :
    func : dropout_grad

661
- backward_op : eig_grad
662 663 664 665 666 667 668 669 670 671 672 673
  forward : eig (Tensor x) -> Tensor(out_w), Tensor(out_v)
  args : (Tensor out_w, Tensor out_v, Tensor out_w_grad, Tensor out_v_grad)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [out_v]
  kernel :
    func : eig_grad
    data_type : out_v
  data_transform:
    skip_transform : out_w, out_w_grad

674
- backward_op : eigh_grad
Z
zyfncg 已提交
675 676 677 678 679 680 681 682 683 684 685 686
  forward : eigh (Tensor x, str uplo) -> Tensor(out_w), Tensor(out_v)
  args : (Tensor out_w, Tensor out_v, Tensor out_w_grad, Tensor out_v_grad)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [out_v]
  kernel :
    func : eigh_grad
    data_type : out_v
  data_transform:
    skip_transform : out_w, out_w_grad

687
- backward_op : eigvalsh_grad
688 689 690 691 692 693 694 695 696 697 698
  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

699
- backward_op : einsum_grad
Z
zyfncg 已提交
700 701 702 703 704 705 706 707 708
  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

709
- backward_op : elementwise_pow_grad
Z
zyfncg 已提交
710 711 712 713 714 715 716 717 718
  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

719
- backward_op : elu_double_grad
Z
zyfncg 已提交
720 721 722 723 724 725 726 727 728 729
  forward : elu_grad (Tensor x, Tensor out, Tensor grad_out, float alpha)-> Tensor(grad_x)
  args : (Tensor x, Tensor grad_out, Tensor grad_x_grad, float alpha)
  output : Tensor(x_grad), Tensor(grad_out_grad)
  infer_meta :
    func : GeneralBinaryGradInferMeta
    param : [x, x]
  kernel :
    func : elu_double_grad
  inplace : (grad_x_grad -> grad_out_grad)

730
- backward_op : elu_grad
Z
zyfncg 已提交
731 732 733 734 735 736 737 738 739 740 741
  forward : elu (Tensor x, float alpha) -> Tensor(out)
  args : (Tensor x, Tensor out, Tensor out_grad, float alpha)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : elu_grad
  backward : elu_double_grad
  inplace : (out_grad -> x_grad)

742
- backward_op : embedding_grad
Z
zyfncg 已提交
743 744 745 746 747
  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)

748
- backward_op : exp_grad
Z
zyfncg 已提交
749 750 751 752 753 754 755 756 757 758
  forward : exp (Tensor x) -> Tensor(out)
  args : (Tensor out, Tensor out_grad)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [out]
  kernel :
    func : exp_grad
  inplace : (out_grad -> x_grad)

759
- backward_op : expand_as_grad
Z
zyfncg 已提交
760 761 762 763 764 765 766 767 768 769
  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

770
- backward_op : expand_double_grad
Z
zyfncg 已提交
771 772 773 774 775 776 777 778
  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)
  infer_meta :
    func : ExpandInferMeta
  kernel :
    func : expand

779
- backward_op : expand_grad
Z
zyfncg 已提交
780 781 782 783 784 785 786 787 788 789 790
  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

791
- backward_op : expm1_grad
Z
zyfncg 已提交
792 793 794 795 796 797 798 799 800 801
  forward : expm1 (Tensor x) -> Tensor(out)
  args : (Tensor out, Tensor out_grad)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [out]
  kernel :
    func : expm1_grad
  inplace : (out_grad -> x_grad)

802
- backward_op : exponential__grad
803 804 805 806 807
  forward : exponential_ (Tensor x, float lambda) -> Tensor(out)
  args : (Tensor out_grad)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
808
  invoke : zeros_like(out_grad)
809

810
- backward_op : fill_diagonal_grad
Z
zhiboniu 已提交
811 812 813 814 815 816 817
  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 已提交
818

819
- backward_op : fill_diagonal_tensor_grad
Z
zhiboniu 已提交
820 821 822 823 824 825 826
  forward : fill_diagonal_tensor (Tensor x, Tensor y, int64_t offset, int dim1, int dim2) -> Tensor(out)
  args : (Tensor out_grad, int64_t offset, int dim1, int dim2)
  output : Tensor(x_grad)
  infer_meta :
    func : FillDiagonalTensorGradInferMeta
  kernel :
    func : fill_diagonal_tensor_grad
827 828
  inplace : (out_grad -> x_grad)

829
- backward_op : fill_grad
830 831 832 833 834 835 836 837 838 839
  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)

840
- backward_op : flatten_grad
Z
zyfncg 已提交
841 842 843 844 845 846 847 848 849 850 851 852 853
  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)

854
- backward_op : flip_grad
Z
zyfncg 已提交
855 856 857
  forward : flip (Tensor x, int[] axis) -> Tensor(out)
  args : (Tensor out_grad, int[] axis)
  output : Tensor(x_grad)
858
  invoke : flip(out_grad, axis)
Z
zyfncg 已提交
859

860
- backward_op : floor_grad
Z
zyfncg 已提交
861 862 863 864 865 866 867 868 869 870
  forward : floor(Tensor x) -> Tensor(out)
  args : (Tensor out_grad)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param: [out_grad]
  kernel :
    func : floor_grad
  inplace : (out_grad -> x_grad)

871
- backward_op : fmax_grad
Z
zyfncg 已提交
872 873 874 875 876 877 878 879 880
  forward : fmax(Tensor x, Tensor y, int axis) -> 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 : fmax_grad

881
- backward_op : fmin_grad
Z
zyfncg 已提交
882 883 884 885 886 887 888 889 890
  forward : fmin(Tensor x, Tensor y, int axis) -> 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 : fmin_grad

891
- backward_op : frame_grad
C
Charles-hit 已提交
892 893 894 895 896 897 898 899 900
  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

901
- backward_op : frobenius_norm_grad
Z
zyfncg 已提交
902 903 904 905 906 907 908 909 910
  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

911
- backward_op : gather_grad
Z
zyfncg 已提交
912 913 914 915 916 917 918 919 920 921 922
  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

923
- backward_op : gather_nd_grad
Z
zyfncg 已提交
924 925 926 927 928 929 930 931 932 933
  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

934
- backward_op : gelu_grad
Z
zyfncg 已提交
935 936 937 938 939 940 941 942 943
  forward : gelu(Tensor x,  bool approximate) -> Tensor(out)
  args : (Tensor x, Tensor out_grad,  bool approximate)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param: [x]
  kernel :
    func : gelu_grad

944
- backward_op : graph_send_recv_grad
945 946
  forward : graph_send_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")
Z
zyfncg 已提交
947 948 949 950 951 952
  output : Tensor(x_grad)
  infer_meta :
    func : GeneralUnaryGradInferMeta
    param : [x]
  kernel :
    func : graph_send_recv_grad
953 954 955
    data_type : out_grad
  optional: out, dst_count

956
- backward_op : graph_send_ue_recv_grad
957 958 959 960 961 962 963 964
  forward : graph_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 : graph_send_ue_recv_grad
Z
zyfncg 已提交
965 966 967
    data_type : out_grad
  optional: out, dst_count

968
- backward_op : grid_sample_grad
W
Wang Bojun 已提交
969 970 971
  forward : grid_sample (Tensor x, Tensor grid, str mode, str padding_mode, bool align_corners) -> Tensor(out)
  args : (Tensor x, Tensor grid, Tensor out_grad, str mode, str padding_mode, bool align_corners)
  output : Tensor(x_grad), Tensor(grid_grad)
972
  infer_meta :
W
Wang Bojun 已提交
973 974
    func : GeneralBinaryGradInferMeta
    param : [x, grid]
975
  kernel :
W
Wang Bojun 已提交
976 977 978
    func : grid_sample_grad
    data_type : x

979
- backward_op : group_norm_grad
Z
zyfncg 已提交
980 981 982 983 984 985 986 987 988 989 990 991
  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)

992
- backward_op : gumbel_softmax_grad
Z
zyfncg 已提交
993 994 995 996 997 998 999 1000 1001
  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

1002
- backward_op : hard_shrink_grad
Z
zyfncg 已提交
1003 1004 1005 1006 1007 1008 1009 1010 1011 1012
  forward : hard_shrink (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 : hard_shrink_grad
  inplace : (out_grad -> x_grad)

1013
- backward_op : hard_sigmoid_grad
Z
zyfncg 已提交
1014 1015 1016 1017 1018 1019 1020 1021 1022 1023
  forward : hard_sigmoid (Tensor x, float slope, float offset) -> Tensor(out)
  args : (Tensor out, Tensor out_grad, float slope, float offset)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [out]
  kernel :
    func : hard_sigmoid_grad
  inplace : (out_grad -> x_grad)

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

1035
- backward_op : hierarchical_sigmoid_grad
1036 1037 1038 1039 1040 1041 1042 1043 1044 1045
  forward : hierarchical_sigmoid (Tensor x, Tensor w, Tensor label, Tensor path, Tensor code, Tensor bias, int num_classes, bool remote_prefetch, int trainer_id, int64_t[] height_sections, str[] epmap, str[] table_names, 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, int trainer_id, int64_t[] height_sections, str[] epmap, str[] table_names, bool is_sparse)
  output : Tensor(x_grad), Tensor(w_grad), Tensor(bias_grad)
  infer_meta :
    func : GeneralTernaryGradInferMeta
    param : [x ,w, bias]
  optional: path, code, bias
  kernel :
    func : hierarchical_sigmoid_grad

1046
- backward_op : huber_loss_grad
Z
zyfncg 已提交
1047 1048 1049 1050 1051 1052 1053 1054 1055
  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

1056
- backward_op : imag_grad
Z
zyfncg 已提交
1057 1058 1059 1060 1061
  forward : imag (Tensor x) -> Tensor(out)
  args : (Tensor out_grad)
  output : Tensor(x_grad)
  invoke : imag_grad_impl(out_grad, x_grad)

1062
- backward_op : index_add_grad
L
Li Min 已提交
1063 1064 1065 1066 1067 1068 1069 1070 1071 1072
  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)

1073
- backward_op : index_sample_grad
Z
zyfncg 已提交
1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084
  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
    data_type : out_grad
  no_need_buffer : x

1085
- backward_op : index_select_grad
Z
zyfncg 已提交
1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096
  forward : index_select(Tensor x, Tensor index,  int dim) -> Tensor(out)
  args : (Tensor x, Tensor index, Tensor out_grad,  int dim)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : index_select_grad
    data_type : x
  no_need_buffer : x

1097
- backward_op : instance_norm_double_grad
Z
zyfncg 已提交
1098 1099 1100 1101 1102 1103 1104 1105 1106 1107
  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

1108
- backward_op : instance_norm_grad
Z
zyfncg 已提交
1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119
  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

1120
- backward_op : inverse_grad
1121 1122 1123 1124 1125 1126 1127 1128
  forward : inverse(Tensor x) -> Tensor(out)
  args : (Tensor out, Tensor out_grad)
  output : Tensor(x_grad)
  infer_meta:
    func : InverseGradInferMeta
  kernel :
    func : inverse_grad

1129
- backward_op : kldiv_loss_grad
Z
zyfncg 已提交
1130 1131 1132 1133 1134 1135 1136 1137 1138 1139
  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

1140
- backward_op : kron_grad
Z
zyfncg 已提交
1141 1142 1143 1144 1145 1146 1147 1148 1149 1150
  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

1151
- backward_op : kthvalue_grad
Z
zyfncg 已提交
1152 1153 1154 1155 1156 1157 1158 1159 1160
  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

1161
- backward_op : label_smooth_grad
Z
zyfncg 已提交
1162 1163 1164 1165 1166 1167 1168 1169 1170
  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

1171
- backward_op : layer_norm_grad
Z
zyfncg 已提交
1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183
  forward : layer_norm (Tensor x, Tensor scale, Tensor bias, float epsilon, int begin_norm_axis, bool is_test) -> 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, bool is_test)
  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

1184
- backward_op : leaky_relu_double_grad
Z
zyfncg 已提交
1185 1186 1187 1188 1189 1190 1191 1192 1193 1194
  forward : leaky_relu_grad (Tensor x, Tensor grad_out, float alpha) -> Tensor(grad_x)
  args : (Tensor x, Tensor grad_x_grad, float alpha)
  output : Tensor(grad_out_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [grad_x_grad]
  kernel :
    func : leaky_relu_double_grad
  inplace : (grad_x_grad -> grad_out_grad)

1195
- backward_op : leaky_relu_grad
Z
zyfncg 已提交
1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206
  forward : leaky_relu (Tensor x, float alpha) -> Tensor(out)
  args : (Tensor x, Tensor out_grad, float alpha)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : leaky_relu_grad
  backward : leaky_relu_double_grad
  inplace : (out_grad -> x_grad)

1207
- backward_op : lerp_grad
Z
zyfncg 已提交
1208 1209 1210 1211 1212 1213 1214 1215 1216
  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

1217
- backward_op : linear_interp_grad
1218
  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)
1219 1220 1221 1222 1223 1224 1225
  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 :
1226
    func : linear_interp_grad
1227 1228
    data_type : output_grad

1229
- backward_op : log10_grad
Z
zyfncg 已提交
1230 1231 1232 1233 1234 1235 1236 1237 1238 1239
  forward : log10 (Tensor x) -> Tensor(out)
  args : (Tensor x, Tensor out_grad)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : log10_grad
  inplace : (out_grad -> x_grad)

1240
- backward_op : log1p_grad
Z
zyfncg 已提交
1241 1242 1243 1244 1245 1246 1247 1248 1249 1250
  forward : log1p (Tensor x) -> Tensor(out)
  args : (Tensor x, Tensor out_grad)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : log1p_grad
  inplace : (out_grad -> x_grad)

1251
- backward_op : log2_grad
Z
zyfncg 已提交
1252 1253 1254 1255 1256 1257 1258 1259 1260 1261
  forward : log2 (Tensor x) -> Tensor(out)
  args : (Tensor x, Tensor out_grad)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : log2_grad
  inplace : (out_grad -> x_grad)

1262
- backward_op : log_double_grad
Z
zyfncg 已提交
1263 1264 1265 1266 1267 1268 1269 1270 1271 1272
  forward : log_grad (Tensor x, Tensor grad_out) -> Tensor(grad_x)
  args : (Tensor x, Tensor grad_out, Tensor grad_x_grad)
  output : Tensor(x_grad), Tensor(grad_out_grad)
  infer_meta :
    func : GeneralBinaryGradInferMeta
    param : [x, x]
  kernel :
    func : log_double_grad
  inplace : (grad_x_grad -> grad_out_grad)

1273
- backward_op : log_grad
Z
zyfncg 已提交
1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284
  forward : log (Tensor x) -> Tensor(out)
  args : (Tensor x, Tensor out_grad)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : log_grad
  backward : log_double_grad
  inplace : (out_grad -> x_grad)

1285
- backward_op : log_loss_grad
Z
zyfncg 已提交
1286 1287 1288 1289 1290 1291 1292 1293 1294
  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

1295
- backward_op : log_softmax_grad
Z
zyfncg 已提交
1296 1297 1298 1299 1300 1301 1302 1303 1304
  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

1305
- backward_op : logcumsumexp_grad
Z
zyfncg 已提交
1306 1307 1308 1309 1310 1311 1312 1313 1314
  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

1315
- backward_op : logit_grad
Z
zyfncg 已提交
1316 1317 1318 1319 1320 1321 1322 1323 1324
  forward : logit (Tensor x, float eps = 1e-6f) -> Tensor(out)
  args : (Tensor x, Tensor out_grad, float eps)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : logit_grad

1325
- backward_op : logsigmoid_grad
Z
zyfncg 已提交
1326 1327 1328 1329 1330 1331 1332 1333 1334 1335
  forward : logsigmoid (Tensor x) -> Tensor(out)
  args : (Tensor x, Tensor out_grad)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : logsigmoid_grad
  inplace : (out_grad -> x_grad)

1336
- backward_op : logsumexp_grad
Z
zyfncg 已提交
1337 1338 1339 1340 1341 1342 1343 1344 1345
  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

1346
- backward_op : lu_grad
L
Lin Manhui 已提交
1347 1348 1349 1350 1351 1352 1353 1354
  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

1355
- backward_op : lu_unpack_grad
1356 1357 1358 1359 1360 1361 1362 1363
  forward : lu_unpack (Tensor x, Tensor pivots, bool unpack_ludata, bool unpack_pivots) -> Tensor(pmat), Tensor(l), Tensor(u)
  args : (Tensor x, Tensor pivots, Tensor l, Tensor u, Tensor pmat, Tensor l_grad, Tensor u_grad, bool unpack_ludata, bool unpack_pivots)
  output : Tensor(x_grad)
  infer_meta :
    func : LUUnpackGradInferMeta
  kernel :
    func : lu_unpack_grad

1364
- backward_op : margin_cross_entropy_grad
1365 1366 1367 1368 1369 1370 1371 1372 1373 1374
  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)

1375
- backward_op : masked_select_grad
Z
zyfncg 已提交
1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386
  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

1387
- backward_op : matmul_double_grad
Z
zyfncg 已提交
1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398
  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

1399
- backward_op : matmul_grad
Z
zyfncg 已提交
1400 1401 1402 1403 1404 1405 1406 1407 1408 1409
  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

1410
- backward_op : matmul_triple_grad
Z
zyfncg 已提交
1411 1412 1413 1414 1415 1416 1417 1418 1419 1420
  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

1421
- backward_op : matrix_power_grad
Z
zyfncg 已提交
1422 1423 1424 1425 1426 1427 1428 1429 1430
  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

1431
- backward_op : max_grad
1432 1433
  forward: max (Tensor x,  IntArray dims={},  bool keep_dim=false) -> Tensor(out)
  args : (Tensor x, Tensor out, Tensor out_grad, IntArray dims={}, bool keep_dim=false, bool reduce_all=false)
Z
zyfncg 已提交
1434 1435 1436 1437 1438 1439 1440
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param: [x]
  kernel :
    func : max_grad

1441
- backward_op : max_pool2d_with_index_grad
Z
zyfncg 已提交
1442 1443 1444 1445 1446 1447 1448 1449
  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

1450
- backward_op : max_pool3d_with_index_grad
Z
zyfncg 已提交
1451 1452 1453 1454 1455 1456 1457 1458
  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

1459
- backward_op : maximum_grad
Z
zyfncg 已提交
1460 1461 1462 1463 1464 1465 1466 1467 1468
  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

1469
- backward_op : maxout_grad
Z
zyfncg 已提交
1470 1471 1472 1473 1474 1475 1476 1477 1478
  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

1479
- backward_op : mean_all_grad
Z
zyfncg 已提交
1480 1481 1482 1483 1484 1485 1486 1487 1488
  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

1489
- backward_op : mean_double_grad
1490 1491
  forward: mean_grad (Tensor x, Tensor grad_out, IntArray dims={},  bool keep_dim=false, bool reduce_all = false) -> Tensor(grad_x)
  args : (Tensor grad_x_grad, IntArray dims={},  bool keep_dim=false)
Z
zyfncg 已提交
1492 1493 1494
  output : Tensor(grad_out_grad)
  invoke : mean(grad_x_grad, dims, keep_dim)

1495
- backward_op : mean_grad
1496 1497
  forward: mean (Tensor x,  IntArray dims={},  bool keep_dim=false) -> Tensor(out)
  args : (Tensor x, Tensor out_grad, IntArray dims={},  bool keep_dim=false, bool reduce_all=false)
Z
zyfncg 已提交
1498 1499 1500 1501 1502 1503 1504 1505 1506
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param: [x]
  kernel :
    func : mean_grad
  backward : mean_double_grad
  no_need_buffer : x

1507
- backward_op : meshgrid_grad
Z
zyfncg 已提交
1508 1509 1510 1511 1512 1513 1514 1515
  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

1516
- backward_op : min_grad
1517 1518
  forward: min (Tensor x,  IntArray dims={},  bool keep_dim=false) -> Tensor(out)
  args : (Tensor x, Tensor out, Tensor out_grad, IntArray dims={}, bool keep_dim=false, bool reduce_all=false)
Z
zyfncg 已提交
1519 1520 1521 1522 1523 1524 1525
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param: [x]
  kernel :
    func : min_grad

1526
- backward_op : minimum_grad
Z
zyfncg 已提交
1527 1528 1529 1530 1531 1532 1533 1534 1535
  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

1536
- backward_op : mish_grad
Z
zyfncg 已提交
1537 1538 1539 1540 1541 1542 1543 1544 1545 1546
  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)

1547
- backward_op : mode_grad
Z
zyfncg 已提交
1548 1549 1550 1551 1552 1553 1554 1555 1556
  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

1557
- backward_op : multi_dot_grad
Z
zyfncg 已提交
1558 1559 1560 1561 1562 1563 1564 1565
  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

1566
- backward_op : multiplex_grad
Z
zyfncg 已提交
1567 1568 1569 1570 1571 1572 1573 1574 1575 1576
  forward : multiplex (Tensor[] ins, Tensor ids) -> Tensor(out)
  args : (Tensor[] ins, Tensor ids, Tensor out_grad)
  output : Tensor[](ins_grad){ins.size()}
  infer_meta :
    func : MultiplexGradInferMeta
    param : [ids, out_grad]
  kernel :
    func : multiplex_grad
    param : [ids, out_grad]

1577
- backward_op : multiply_double_grad
Z
zyfncg 已提交
1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589
  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)

1590
- backward_op : multiply_grad
Z
zyfncg 已提交
1591 1592 1593 1594 1595 1596 1597 1598 1599 1600
  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

1601
- backward_op : multiply_triple_grad
Z
zyfncg 已提交
1602 1603 1604 1605 1606 1607 1608 1609 1610 1611
  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

1612
- backward_op : nearest_interp_grad
1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623
  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

1624
- backward_op : nll_loss_grad
Z
zyfncg 已提交
1625 1626 1627 1628 1629 1630 1631 1632 1633 1634
  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

1635
- backward_op : norm_grad
Z
zyfncg 已提交
1636 1637 1638 1639 1640 1641 1642 1643 1644
  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

1645
- backward_op : overlap_add_grad
1646 1647 1648 1649 1650 1651 1652 1653 1654
  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

1655
- backward_op : p_norm_grad
Z
zyfncg 已提交
1656 1657 1658 1659 1660 1661 1662 1663 1664
  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

1665
- backward_op : pad3d_double_grad
Z
zyfncg 已提交
1666 1667 1668 1669 1670 1671 1672 1673
  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

1674
- backward_op : pad3d_grad
Z
zyfncg 已提交
1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685
  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

1686
- backward_op : pad_double_grad
1687 1688
  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 已提交
1689 1690 1691 1692 1693 1694
  output : Tensor(grad_out_grad)
  infer_meta :
    func : PadInferMeta
  kernel :
    func : pad

1695
- backward_op : pad_grad
1696 1697
  forward : pad(Tensor x, int[] paddings, Scalar pad_value) -> Tensor(out)
  args : (Tensor x, Tensor out_grad, int[] paddings, Scalar pad_value)
Z
zyfncg 已提交
1698 1699 1700 1701 1702 1703 1704 1705 1706 1707
  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

1708
- backward_op : pixel_shuffle_grad
Z
zyfncg 已提交
1709 1710 1711 1712 1713 1714 1715 1716
  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

1717
- backward_op : pool2d_double_grad
1718 1719
  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, bool use_gpudnn) -> Tensor(grad_x)
  args : (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, bool use_gpudnn)
Z
zyfncg 已提交
1720 1721
  output : Tensor(grad_out_grad)
  infer_meta :
1722
    func : Pool2DInferMeta
1723
    param : [grad_x_grad, kernel_size, strides, paddings, ceil_mode, exclusive, data_format, pooling_type, global_pooling, adaptive, padding_algorithm]
Z
zyfncg 已提交
1724 1725
  kernel :
    func : pool2d_double_grad
1726 1727
    param : [grad_x_grad, kernel_size, strides, paddings, ceil_mode, exclusive, data_format, pooling_type, global_pooling, adaptive, padding_algorithm]
    use_gpudnn : use_gpudnn
Z
zyfncg 已提交
1728

1729
- backward_op : pool2d_grad
1730 1731
  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, bool use_gpudnn) -> 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, bool use_gpudnn)
Z
zyfncg 已提交
1732 1733
  output : Tensor(x_grad)
  infer_meta :
1734 1735
    func : UnchangedInferMeta
    param: [x]
Z
zyfncg 已提交
1736 1737
  kernel :
    func : pool2d_grad
1738 1739
    param : [x, out, out_grad, kernel_size, strides, paddings, ceil_mode, exclusive, data_format, pooling_type, global_pooling, adaptive, padding_algorithm]
    use_gpudnn : use_gpudnn
Z
zyfncg 已提交
1740 1741
  backward : pool2d_double_grad

1742
- backward_op : pool3d_grad
1743 1744
  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, bool use_gpudnn) -> 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, bool use_gpudnn)
Z
zyfncg 已提交
1745 1746
  output : Tensor(x_grad)
  infer_meta :
1747 1748
    func : UnchangedInferMeta
    param: [x]
Z
zyfncg 已提交
1749 1750
  kernel :
    func : pool3d_grad
1751 1752
    param : [x, out, out_grad, kernel_size, strides, paddings, ceil_mode, exclusive, data_format, pooling_type, global_pooling, adaptive, padding_algorithm]
    use_gpudnn : use_gpudnn
Z
zyfncg 已提交
1753

1754
- backward_op : pow_grad
Z
zyfncg 已提交
1755 1756 1757 1758 1759 1760 1761 1762 1763 1764
  forward : pow(Tensor x, Scalar s) -> Tensor(out)
  args : (Tensor x, Tensor out_grad, Scalar s=-1)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param: [x]
  kernel :
    func : pow_grad
  inplace : (out_grad -> x_grad)

1765
- backward_op : prelu_grad
Z
zyfncg 已提交
1766 1767 1768 1769 1770 1771 1772 1773 1774
  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

1775
- backward_op : psroi_pool_grad
Z
zyfncg 已提交
1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787
  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
1788
- backward_op : put_along_axis_grad
Z
zyfncg 已提交
1789 1790 1791 1792 1793 1794 1795 1796 1797
  forward : put_along_axis (Tensor x, Tensor index, Tensor value, int axis, str reduce) -> Tensor(out)
  args : (Tensor x, Tensor index, Tensor out_grad, int axis, str reduce)
  output : Tensor(x_grad), Tensor(value_grad)
  infer_meta :
    func : GeneralBinaryGradInferMeta
    param : [x, index]
  kernel :
    func : put_along_axis_grad

1798
- backward_op : qr_grad
Y
Yulong Ao 已提交
1799 1800 1801 1802 1803 1804 1805 1806 1807
  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

1808
- backward_op : real_grad
Z
zyfncg 已提交
1809 1810 1811 1812 1813
  forward : real (Tensor x) -> Tensor(out)
  args : (Tensor out_grad)
  output : Tensor(x_grad)
  invoke : real_grad_impl(out_grad, x_grad)

1814
- backward_op : reciprocal_grad
Z
zyfncg 已提交
1815 1816 1817 1818 1819 1820 1821 1822 1823 1824
  forward : reciprocal (Tensor x) -> Tensor(out)
  args : (Tensor out, Tensor out_grad)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [out]
  kernel :
    func : reciprocal_grad
  inplace : (out_grad -> x_grad)

1825
- backward_op : reduce_prod_grad
1826 1827
  forward : reduce_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)
Z
zyfncg 已提交
1828 1829 1830 1831 1832 1833 1834
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : prod_grad

1835
- backward_op : relu6_grad
1836 1837 1838 1839 1840 1841 1842 1843 1844 1845
  forward : relu6 (Tensor x, float threshold) -> Tensor(out)
  args : (Tensor out, Tensor out_grad, float threshold)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [out]
  kernel :
    func : relu6_grad
  inplace : (out_grad -> x_grad)

1846
- backward_op : relu_double_grad
Z
zyfncg 已提交
1847 1848 1849 1850 1851 1852 1853 1854 1855 1856
  forward : relu_grad (Tensor out, Tensor grad_out) -> Tensor(grad_x)
  args : (Tensor out, Tensor grad_x_grad)
  output : Tensor(grad_out_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [out]
  kernel :
    func : relu_double_grad
  inplace : (grad_x_grad -> grad_out_grad)

1857
- backward_op : relu_grad
Z
zyfncg 已提交
1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868
  forward : relu (Tensor x) -> Tensor(out)
  args : (Tensor out, Tensor out_grad)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [out]
  kernel :
    func : relu_grad
  backward: relu_double_grad
  inplace : (out_grad -> x_grad)

1869
- backward_op : renorm_grad
S
seemingwang 已提交
1870 1871 1872 1873 1874 1875 1876 1877 1878
  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

1879
- backward_op : repeat_interleave_grad
S
seemingwang 已提交
1880 1881 1882 1883 1884 1885 1886 1887 1888
  forward : repeat_interleave(Tensor x, int repeats, int dim) -> Tensor(out)
  args : (Tensor x, Tensor out_grad, int repeats, int dim)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : repeat_interleave_grad

1889
- backward_op : repeat_interleave_with_tensor_index_grad
S
seemingwang 已提交
1890 1891 1892 1893 1894 1895 1896 1897 1898 1899
  forward : repeat_interleave_with_tensor_index(Tensor x, Tensor repeats, int dim) -> Tensor(out)
  args : (Tensor x, Tensor repeats, Tensor out_grad, int dim)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : repeat_interleave_with_tensor_index_grad
    data_type : x

1900
- backward_op : reshape_double_grad
Z
zyfncg 已提交
1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911
  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)

1912
- backward_op : reshape_grad
Z
zyfncg 已提交
1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927
  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)

1928
- backward_op : reverse_array_grad
1929 1930
  forward : reverse_array (Tensor[] x, IntArray axis) -> Tensor[](out)
  args : (Tensor[] out_grad, IntArray axis)
W
wanghuancoder 已提交
1931 1932 1933 1934 1935 1936
  output : Tensor[](x_grad){out_grad.size()}
  infer_meta :
    func : ReverseArrayInferMeta
  kernel :
    func : reverse

1937
- backward_op : reverse_grad
1938 1939
  forward : reverse (Tensor x, IntArray axis) -> Tensor(out)
  args : (Tensor out_grad, IntArray axis)
W
wanghuancoder 已提交
1940 1941 1942
  output : Tensor(x_grad)
  invoke : reverse(out_grad, axis)

1943
- backward_op : roi_align_grad
Z
zyfncg 已提交
1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955
  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

1956
- backward_op : roi_pool_grad
Z
zyfncg 已提交
1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967
  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

1968
- backward_op : roll_grad
Z
zyfncg 已提交
1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979
  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

1980
- backward_op : round_grad
Z
zyfncg 已提交
1981 1982 1983 1984 1985 1986 1987 1988 1989 1990
  forward : round(Tensor x) -> Tensor(out)
  args : (Tensor out_grad)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param: [out_grad]
  kernel :
    func : round_grad
  inplace : (out_grad -> x_grad)

1991
- backward_op : rsqrt_double_grad
Z
zyfncg 已提交
1992 1993 1994 1995 1996 1997 1998 1999 2000 2001
  forward : rsqrt_grad (Tensor out, Tensor grad_out) -> Tensor(grad_x)
  args : (Tensor out, Tensor grad_x, Tensor grad_x_grad)
  output : Tensor(out_grad), Tensor(grad_out_grad)
  infer_meta :
    func : GeneralBinaryGradInferMeta
    param : [out, out]
  kernel :
    func : rsqrt_double_grad
  inplace : (grad_x_grad -> grad_out_grad)

2002
- backward_op : rsqrt_grad
Z
zyfncg 已提交
2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013
  forward : rsqrt (Tensor x) -> Tensor(out)
  args : (Tensor out, Tensor out_grad)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [out]
  kernel :
    func : rsqrt_grad
  backward : rsqrt_double_grad
  inplace : (out_grad -> x_grad)

2014
- backward_op : scale_grad
Z
zyfncg 已提交
2015
  forward : scale (Tensor x, Scalar scale, float bias, bool bias_after_scale) -> Tensor(out)
2016
  args : (Tensor out_grad, Scalar scale=1.0, bool bias_after_scale=true)
Z
zyfncg 已提交
2017 2018 2019
  output : Tensor(x_grad)
  invoke : scale(out_grad, scale, 0.0, bias_after_scale)

2020
- backward_op : scatter_grad
Z
zyfncg 已提交
2021 2022 2023 2024 2025 2026 2027 2028 2029 2030
  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

2031
- backward_op : scatter_nd_add_grad
Z
zyfncg 已提交
2032 2033 2034 2035 2036 2037 2038 2039 2040 2041
  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

2042
- backward_op : segment_pool_grad
Z
zyfncg 已提交
2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053
  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

2054
- backward_op : selu_grad
Z
zyfncg 已提交
2055 2056 2057 2058 2059 2060 2061 2062 2063
  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

2064
- backward_op : sigmoid_cross_entropy_with_logits_grad
Z
zyfncg 已提交
2065 2066 2067 2068 2069 2070 2071 2072 2073 2074
  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)

2075
- backward_op : sigmoid_double_grad
Z
zyfncg 已提交
2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086
  forward : sigmoid_grad (Tensor out, Tensor fwd_grad_out) -> Tensor(grad_x)
  args : (Tensor out, Tensor fwd_grad_out, Tensor grad_x_grad)
  output : Tensor(out_grad), Tensor(fwd_grad_out_grad)
  infer_meta :
    func : GeneralBinaryGradInferMeta
    param : [out, fwd_grad_out]
  kernel :
    func : sigmoid_double_grad
  backward : sigmoid_triple_grad
  inplace : (grad_x_grad -> fwd_grad_out_grad)

2087
- backward_op : sigmoid_grad
Z
zyfncg 已提交
2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098
  forward : sigmoid (Tensor x) -> Tensor(out)
  args : (Tensor out, Tensor out_grad)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [out]
  kernel :
    func : sigmoid_grad
  backward : sigmoid_double_grad
  inplace : (out_grad -> x_grad)

2099
- backward_op : sigmoid_triple_grad
Z
zyfncg 已提交
2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110
  forward : sigmoid_double_grad (Tensor out, Tensor fwd_grad_out, Tensor grad_grad_x) -> Tensor(grad_out), Tensor(grad_grad_out)
  args : (Tensor out, Tensor fwd_grad_out, Tensor grad_grad_x, Tensor grad_out_grad, Tensor grad_grad_out_grad)
  output : Tensor(out_grad), Tensor(fwd_grad_out_grad), Tensor(grad_grad_x_grad)
  infer_meta :
    func : GeneralTernaryGradInferMeta
    param : [out, fwd_grad_out, grad_grad_x]
  kernel :
    func : sigmoid_triple_grad
  optional : grad_grad_out_grad
  inplace : (grad_grad_x -> fwd_grad_out_grad)

2111
- backward_op : silu_grad
Z
zyfncg 已提交
2112 2113 2114 2115 2116 2117 2118 2119 2120 2121
  forward : silu (Tensor x) -> Tensor(out)
  args : (Tensor x, Tensor out_grad)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : silu_grad
  inplace : (out_grad -> x_grad)

2122
- backward_op : sin_grad
Z
zyfncg 已提交
2123 2124 2125 2126 2127 2128 2129 2130 2131 2132
  forward : sin (Tensor x) -> Tensor(out)
  args : (Tensor x, Tensor out_grad)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : sin_grad
  inplace : (out_grad -> x_grad)

2133
- backward_op : sinh_grad
Z
zyfncg 已提交
2134 2135 2136 2137 2138 2139 2140 2141 2142 2143
  forward : sinh (Tensor x) -> Tensor(out)
  args : (Tensor x, Tensor out_grad)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : sinh_grad
  inplace : (out_grad -> x_grad)

2144
- backward_op : slice_double_grad
2145 2146 2147 2148 2149 2150 2151 2152 2153
  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)
  infer_meta :
    func : UnchangedInferMeta
    param : [grad_input_grad]
  kernel :
    func : slice

2154
- backward_op : slice_grad
Z
zyfncg 已提交
2155 2156 2157 2158 2159 2160 2161 2162
  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
2163
  backward : slice_double_grad
Z
zyfncg 已提交
2164 2165
  no_need_buffer : input

2166
- backward_op : slogdet_grad
2167 2168 2169 2170 2171 2172 2173 2174 2175
  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

2176
- backward_op : soft_shrink_grad
Z
zyfncg 已提交
2177 2178 2179 2180 2181 2182 2183 2184 2185 2186
  forward : soft_shrink (Tensor x, float lambda) -> Tensor(out)
  args : (Tensor x, Tensor out_grad, float lambda)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : soft_shrink_grad
  inplace : (out_grad -> x_grad)

2187
- backward_op : softmax_grad
Z
zyfncg 已提交
2188 2189 2190 2191 2192 2193 2194 2195 2196 2197
  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
    use_gpudnn : true

2198
- backward_op : softplus_grad
W
Wang Bojun 已提交
2199 2200 2201 2202 2203 2204 2205 2206 2207 2208
  forward : softplus (Tensor x, float beta, float threshold) -> Tensor(out)
  args : (Tensor x, Tensor out_grad, float beta, float threshold)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : softplus_grad
  inplace : (out_grad -> x_grad)

2209
- backward_op : softsign_grad
2210 2211 2212 2213 2214 2215 2216 2217 2218 2219
  forward : softsign (Tensor x) -> Tensor(out)
  args : (Tensor x, Tensor out_grad)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : softsign_grad
  inplace : (out_grad -> x_grad)

2220
- backward_op : spectral_norm_grad
2221 2222 2223 2224 2225 2226 2227 2228 2229
  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

2230
- backward_op : split_grad
Z
zyfncg 已提交
2231 2232 2233 2234
  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 已提交
2235

2236
- backward_op : split_with_num_grad
C
Charles-hit 已提交
2237 2238 2239 2240
  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 已提交
2241 2242
# TODO(zhangyunfei) The config of double grad and triple grad will be supported in the future.

2243
- backward_op : sqrt_double_grad
Z
zyfncg 已提交
2244 2245 2246 2247 2248 2249 2250 2251 2252 2253
  forward : sqrt_grad (Tensor out, Tensor grad_out) -> Tensor(grad_x)
  args : (Tensor out, Tensor grad_x, Tensor grad_x_grad)
  output : Tensor(out_grad), Tensor(grad_out_grad)
  infer_meta :
    func : GeneralBinaryGradInferMeta
    param : [out, out]
  kernel :
    func : sqrt_double_grad
  inplace : (grad_x_grad -> grad_out_grad)

2254
- backward_op : sqrt_grad
Z
zyfncg 已提交
2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265
  forward : sqrt (Tensor x) -> Tensor(out)
  args : (Tensor out, Tensor out_grad)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [out]
  kernel :
    func : sqrt_grad
  backward : sqrt_double_grad
  inplace : (out_grad -> x_grad)

2266
- backward_op : square_double_grad
Z
zyfncg 已提交
2267 2268 2269 2270 2271 2272 2273 2274 2275 2276
  forward : square_grad (Tensor x, Tensor grad_out) -> Tensor(grad_x)
  args : (Tensor x, Tensor grad_out, Tensor grad_x_grad)
  output : Tensor(x_grad), Tensor(grad_out_grad)
  infer_meta :
    func : GeneralBinaryGradInferMeta
    param : [x, x]
  kernel :
    func : square_double_grad
  inplace : (grad_x_grad -> grad_out_grad)

2277
- backward_op : square_grad
Z
zyfncg 已提交
2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288
  forward : square (Tensor x) -> Tensor(out)
  args : (Tensor x, Tensor out_grad)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : square_grad
  backward : square_double_grad
  inplace : (out_grad -> x_grad)

2289
- backward_op : squared_l2_norm_grad
2290 2291 2292 2293 2294 2295 2296 2297 2298
  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

2299
- backward_op : squeeze_double_grad
2300 2301
  forward : squeeze_grad(Tensor xshape, Tensor grad_out, IntArray axes) -> Tensor(grad_x)
  args : (Tensor grad_x_grad, IntArray axes)
Z
zyfncg 已提交
2302 2303 2304
  output : Tensor(grad_out_grad)
  invoke: squeeze(grad_x_grad, axes)

2305
- backward_op : squeeze_grad
2306 2307
  forward : squeeze(Tensor x, IntArray axes) -> Tensor(out), Tensor(xshape)
  args : (Tensor xshape, Tensor out_grad, IntArray axes)
Z
zyfncg 已提交
2308 2309 2310 2311 2312 2313 2314 2315 2316
  output : Tensor(x_grad)
  infer_meta :
    func : KernelWithXShapeInferMeta
    param: [xshape]
  kernel :
    func : squeeze_grad
  inplace : (out_grad -> x_grad)
  backward: squeeze_double_grad

2317
- backward_op : stack_grad
Z
zyfncg 已提交
2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328
  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

2329
- backward_op : strided_slice_grad
Z
zyfncg 已提交
2330 2331 2332 2333 2334 2335 2336 2337 2338 2339
  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

2340
- backward_op : subtract_double_grad
Z
zyfncg 已提交
2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352
  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)

2353
- backward_op : subtract_grad
Z
zyfncg 已提交
2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365
  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)

2366
- backward_op : sum_double_grad
2367 2368
  forward : sum_grad (Tensor x, Tensor grad_out, IntArray dims, bool keep_dim, bool reduce_all=false) -> Tensor(grad_x)
  args : (Tensor grad_x_grad, IntArray dims={}, bool keep_dim=false)
Z
zyfncg 已提交
2369 2370 2371
  output : Tensor(grad_out_grad)
  invoke : sum(grad_x_grad, dims, grad_x_grad.dtype(), keep_dim)

2372
- backward_op : sum_grad
2373 2374
  forward : sum (Tensor x, IntArray dims={}, DataType out_dtype=DataType::UNDEFINED, bool keep_dim=false) -> Tensor(out)
  args : (Tensor x, Tensor out_grad, IntArray dims, bool keep_dim, bool reduce_all=false)
Z
zyfncg 已提交
2375 2376 2377 2378 2379 2380 2381 2382 2383
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : sum_grad
  no_need_buffer : x
  backward : sum_double_grad

2384
- backward_op : svd_grad
2385 2386 2387 2388 2389 2390 2391 2392 2393 2394
  forward : svd (Tensor x, bool full) -> 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)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : svd_grad
  optional: u_grad, vh_grad, s_grad

2395
- backward_op : swish_grad
Z
zyfncg 已提交
2396 2397 2398 2399 2400 2401 2402 2403 2404 2405
  forward : swish (Tensor x, float beta=1.0) -> Tensor(out)
  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)

2406
- backward_op : sync_batch_norm_grad
2407
  forward : sync_batch_norm_ (Tensor x, Tensor scale, Tensor bias, Tensor mean, Tensor variance, float momentum, float epsilon, str data_layout, bool is_test, bool use_global_stats, bool trainable_statistics, bool fuse_with_relu) -> Tensor(out), Tensor(mean_out), Tensor(variance_out), Tensor(saved_mean), Tensor(saved_variance), Tensor(reserve_space)
2408
  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, bool fuse_with_relu)
2409 2410 2411 2412 2413 2414 2415
  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
2416
  optional : reserve_space
2417

2418
- backward_op : take_along_axis_grad
Z
zyfncg 已提交
2419 2420 2421 2422 2423 2424 2425 2426 2427
  forward : take_along_axis (Tensor x, Tensor index, int axis) -> Tensor(out)
  args : (Tensor x, Tensor index, Tensor out_grad, int axis)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : take_along_axis_grad

2428
- backward_op : tan_grad
Z
zyfncg 已提交
2429 2430 2431 2432 2433 2434 2435 2436 2437 2438
  forward : tan (Tensor x) -> Tensor(out)
  args : (Tensor x, Tensor out_grad)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : tan_grad
  inplace : (out_grad -> x_grad)

2439
- backward_op : tanh_double_grad
Z
zyfncg 已提交
2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450
  forward : tanh_grad (Tensor out, Tensor grad_out) -> Tensor(grad_x)
  args : (Tensor out, Tensor grad_out, Tensor grad_x_grad)
  output : Tensor(out_grad), Tensor(grad_out_grad)
  infer_meta :
    func : GeneralBinaryGradInferMeta
    param : [out, out]
  kernel :
    func : tanh_double_grad
  backward : tanh_triple_grad
  inplace : (grad_x_grad -> grad_out_grad)

2451
- backward_op : tanh_grad
Z
zyfncg 已提交
2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462
  forward : tanh (Tensor x) -> Tensor(out)
  args : (Tensor out, Tensor out_grad)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [out]
  kernel :
    func : tanh_grad
  backward : tanh_double_grad
  inplace : (out_grad -> x_grad)

2463
- backward_op : tanh_shrink_grad
Z
zyfncg 已提交
2464 2465 2466 2467 2468 2469 2470 2471 2472 2473
  forward : tanh_shrink (Tensor x) -> Tensor(out)
  args : (Tensor x, Tensor out_grad)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : tanh_shrink_grad
  inplace : (out_grad -> x_grad)

2474
- backward_op : tanh_triple_grad
Z
zyfncg 已提交
2475 2476 2477 2478 2479 2480 2481 2482 2483 2484
  forward : tanh_double_grad (Tensor out, Tensor grad_out_forward, Tensor grad_x_grad_forward) -> Tensor(grad_out_new), Tensor(grad_out_grad)
  args : (Tensor out, Tensor grad_out_forward, Tensor grad_x_grad_forward, Tensor grad_out_new_grad, Tensor grad_out_grad_grad)
  output : Tensor(out_grad), Tensor(grad_out_forward_grad), Tensor(grad_x_grad_forward_grad)
  infer_meta :
    func : GeneralTernaryGradInferMeta
    param : [out, out, grad_x_grad_forward]
  kernel :
    func : tanh_triple_grad
  inplace : (grad_x_grad_forward -> grad_out_forward_grad)

2485
- backward_op : temporal_shift_grad
C
ccrrong 已提交
2486 2487 2488 2489 2490 2491 2492 2493 2494
  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

2495
- backward_op : thresholded_relu_grad
Z
zyfncg 已提交
2496 2497 2498 2499 2500 2501 2502 2503 2504 2505
  forward : thresholded_relu (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 : thresholded_relu_grad
  inplace : (out_grad -> x_grad)

2506
- backward_op : tile_double_grad
Z
zyfncg 已提交
2507 2508 2509 2510 2511 2512 2513 2514
  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)
  infer_meta :
    func : TileInferMeta
  kernel :
    func : tile

2515
- backward_op : tile_grad
Z
zyfncg 已提交
2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526
  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

2527
- backward_op : top_k_grad
Z
zyfncg 已提交
2528 2529 2530 2531 2532 2533 2534 2535 2536
  forward : top_k (Tensor x, Scalar k, int axis = -1, bool largest = true, bool sorted = true) -> Tensor(out), Tensor(indices)
  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

2537
- backward_op : transpose_double_grad
Z
zyfncg 已提交
2538 2539 2540 2541 2542
  forward : transpose_grad (Tensor grad_out, int[] axis) -> Tensor(grad_x)
  args : (Tensor grad_x_grad, int[] axis)
  output : Tensor(grad_out_grad)
  invoke : transpose(grad_x_grad, axis)

2543
- backward_op : transpose_grad
Z
zyfncg 已提交
2544 2545 2546 2547 2548 2549 2550 2551 2552 2553
  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 : transpose_double_grad

2554
- backward_op : triangular_solve_grad
Z
zyfncg 已提交
2555 2556 2557 2558 2559 2560 2561 2562 2563
  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

2564
- backward_op : tril_triu_grad
Z
zyfncg 已提交
2565 2566 2567 2568 2569 2570 2571 2572 2573
  forward : tril_triu(Tensor x,  int diagonal,  bool lower) -> Tensor(out)
  args : (Tensor out_grad,  int diagonal,  bool lower)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [out_grad]
  kernel :
    func : tril_triu_grad

2574
- backward_op : trilinear_interp_grad
2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585
  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

2586
- backward_op : unbind_grad
Z
zyfncg 已提交
2587 2588 2589 2590 2591
  forward : unbind (Tensor input, int axis) -> Tensor[](out)
  args : (Tensor[] out_grad, int axis)
  output : Tensor(input_grad)
  invoke : stack(out_grad, axis)

2592
- backward_op : unfold_grad
Z
zyfncg 已提交
2593 2594 2595 2596 2597 2598 2599 2600 2601 2602
  forward : unfold (Tensor x, int[] kernel_sizes, int[] strides, int[] paddings, int[] dilations) -> Tensor(out)
  args : (Tensor x, Tensor out_grad, int[] kernel_sizes, int[] strides, int[] paddings, int[] dilations)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : unfold_grad
  no_need_buffer : x

2603
- backward_op : uniform_random_inplace_grad
2604 2605 2606 2607 2608 2609 2610 2611 2612
  forward : uniform_random_inplace(Tensor x, float min, float max, int seed, int diag_num, int diag_step, float diag_val) -> Tensor(out)
  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 :
    func : uniform_random_inplace_grad
  inplace : (out_grad -> x_grad)

2613
- backward_op : unsqueeze_double_grad
Z
zyfncg 已提交
2614 2615 2616 2617 2618
  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)

2619
- backward_op : unsqueeze_grad
Z
zyfncg 已提交
2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631
  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

2632
- backward_op : unstack_grad
2633 2634 2635 2636 2637 2638 2639 2640 2641
  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

2642
- backward_op : warpctc_grad
2643
  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 已提交
2644 2645 2646 2647 2648 2649 2650 2651 2652 2653
  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

2654
- backward_op : where_grad
Z
zyfncg 已提交
2655 2656 2657 2658 2659 2660 2661 2662 2663
  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
2664

2665
- backward_op : yolov3_loss_grad
2666 2667 2668 2669 2670 2671 2672 2673
  forward : yolov3_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)
  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 :
    func : Yolov3LossGradInferMeta
  kernel :
    func : yolov3_loss_grad
  optional : gt_score
X
xiaoting 已提交
2674

2675
- backward_op: fold_grad
X
xiaoting 已提交
2676 2677 2678 2679 2680 2681 2682 2683 2684 2685
  forward: fold (Tensor x, int[] output_sizes, int[] kernel_sizes, int[] strides, int[] paddings, int[] dilations) -> Tensor(out)
  args: (Tensor x, Tensor out_grad, int[] output_sizes, int[] kernel_sizes, int[] strides, int[] paddings, int[] dilations)
  output: Tensor(x_grad)
  infer_meta:
    func: UnchangedInferMeta
    param : [x]
  kernel:
    func: fold_grad
  no_need_buffer : x

2686
- backward_op: unpool3d_grad
X
xiaoting 已提交
2687 2688 2689 2690 2691 2692 2693 2694 2695 2696
  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

2697
- backward_op: unpool_grad
2698 2699
  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 已提交
2700 2701 2702 2703 2704 2705 2706
  output: Tensor(x_grad)
  infer_meta:
    func: UnchangedInferMeta
    param : [x]
  kernel:
    func: unpool_grad
    data_type: x