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

11
- backward_op : abs_grad
Z
zyfncg 已提交
12 13 14 15 16 17 18 19
  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
20
  composite : abs_grad(x, out_grad, x_grad)
Z
zyfncg 已提交
21 22
  backward : abs_double_grad

23
- backward_op : add_double_grad
Z
zyfncg 已提交
24 25 26 27 28 29 30 31 32 33 34 35
  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)

36
- backward_op : add_grad
Z
zyfncg 已提交
37 38 39 40 41 42 43 44 45
  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
46
  composite : add_grad(x, y, out_grad, axis, x_grad, y_grad)
Z
zyfncg 已提交
47 48 49
  backward : add_double_grad
  inplace : (out_grad -> x_grad)

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

61
- backward_op : amax_grad
62 63
  forward: amax (Tensor x,  int64_t[] axis={},  bool keepdim=false) -> Tensor(out)
  args : (Tensor x, Tensor out, Tensor out_grad, int64_t[] axis={},  bool keepdim=false, bool reduce_all=false)
64 65 66 67 68 69 70
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param: [x]
  kernel :
    func : amax_grad

71
- backward_op : amin_grad
72 73
  forward: amin (Tensor x,  int64_t[] axis={},  bool keepdim=false) -> Tensor(out)
  args : (Tensor x, Tensor out, Tensor out_grad, int64_t[] axis={},  bool keepdim=false, bool reduce_all=false)
74 75 76 77 78 79 80
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param: [x]
  kernel :
    func : amin_grad

81
- backward_op : assign_grad
Z
zyfncg 已提交
82 83 84
  forward : assign (Tensor x) -> Tensor(out)
  args : (Tensor out_grad)
  output : Tensor(x_grad)
85
  composite: assign_grad(out_grad, x_grad)
86
  invoke : assign(out_grad)
Z
zyfncg 已提交
87

88
- backward_op : assign_out__grad
Z
zyfncg 已提交
89 90 91 92 93 94 95 96 97
  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)

98
- backward_op : batch_norm_double_grad
99 100
  forward : batch_norm_grad (Tensor x, Tensor scale, Tensor bias, Tensor out_mean, Tensor out_variance, Tensor saved_mean, Tensor saved_variance, Tensor reserve_space, Tensor grad_out, float momentum, float epsilon, str data_layout, bool is_test, bool use_global_stats, bool trainable_statistics) -> Tensor(grad_x), Tensor(grad_scale), Tensor(grad_bias)
  args : (Tensor x, Tensor scale, Tensor out_mean, Tensor out_variance, Tensor saved_mean, Tensor saved_variance, Tensor grad_out,  Tensor grad_x_grad, Tensor grad_scale_grad, Tensor grad_bias_grad, float momentum, float epsilon, str data_layout, bool is_test, bool use_global_stats, bool trainable_statistics)
Z
zyfncg 已提交
101 102 103 104 105
  output : Tensor(x_grad), Tensor(scale_grad), Tensor(grad_out_grad)
  infer_meta :
    func : GeneralTernaryGradInferMeta
    param : [x, scale, x]
  kernel :
106
    func : batch_norm_double_grad
Z
zyfncg 已提交
107
    data_type : x
108
  optional : out_mean, out_variance, grad_x_grad, grad_scale_grad, grad_bias_grad
Z
zyfncg 已提交
109 110
  inplace : (grad_out -> grad_out_grad)

111
- backward_op : batch_norm_grad
112 113
  forward : batch_norm (Tensor x, Tensor mean, Tensor variance, Tensor scale, Tensor bias, bool is_test, float momentum, float epsilon, str data_layout, bool use_global_stats, bool trainable_statistics) -> Tensor(out), Tensor(mean_out), Tensor(variance_out), Tensor(saved_mean), Tensor(saved_variance), Tensor(reserve_space)
  args : (Tensor x, Tensor scale, Tensor bias, Tensor mean_out, Tensor variance_out, Tensor saved_mean, Tensor saved_variance, Tensor reserve_space, Tensor out_grad, float momentum, float epsilon, str data_layout, bool is_test, bool use_global_stats, bool trainable_statistics)
Z
zyfncg 已提交
114 115 116 117 118 119 120 121
  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
122
  composite: batch_norm_grad(x, scale, bias, mean_out, variance_out, saved_mean, saved_variance, reserve_space, out_grad, momentum, epsilon, data_layout, is_test, use_global_stats, trainable_statistics)
Z
zyfncg 已提交
123 124
  backward : batch_norm_double_grad

125
- backward_op : cast_grad
126
  forward : cast (Tensor x, DataType dtype) -> Tensor(out)
Z
zyfncg 已提交
127 128
  args : (Tensor x, Tensor out_grad)
  output : Tensor(x_grad)
129
  invoke : cast (out_grad, x.dtype())
130
  composite: cast_grad(x, out_grad, x_grad)
Z
zyfncg 已提交
131 132
  no_need_buffer : x

133 134 135 136 137 138 139 140 141
- backward_op : channel_shuffle_grad
  forward : channel_shuffle (Tensor x, int groups, str data_format="NCHW") -> Tensor(out)
  args : (Tensor out_grad, int groups, str data_format="NCHW")
  output : Tensor(x_grad)
  infer_meta :
    func : ChannelShuffleGradInferMeta
  kernel :
    func : channel_shuffle_grad

142
- backward_op : concat_double_grad
Z
zyfncg 已提交
143 144 145
  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)
146
  invoke : concat(grad_x_grad, axis)
Z
zyfncg 已提交
147

148
- backward_op : concat_grad
Z
zyfncg 已提交
149 150 151 152 153 154 155 156
  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
W
wangzhen38 已提交
157
  composite : concat_grad(x, out_grad, axis, x_grad)
Z
zyfncg 已提交
158 159 160
  no_need_buffer : x
  backward : concat_double_grad

161
- backward_op : conv2d_grad
162 163
  forward : conv2d (Tensor input, Tensor filter, int[] strides, int[] paddings, str padding_algorithm, int[] dilations, int groups, str data_format) -> Tensor(out)
  args : (Tensor input, Tensor filter, Tensor out_grad,  int[] strides, int[] paddings, str padding_algorithm, int[] dilations, int groups, str data_format)
Z
zyfncg 已提交
164
  output : Tensor(input_grad), Tensor(filter_grad)
Z
zyfncg 已提交
165 166 167 168 169
  infer_meta :
    func : GeneralBinaryGradInferMeta
    param : [input, filter]
  kernel :
    func : conv2d_grad
Z
zyfncg 已提交
170 171
  backward : conv2d_grad_grad

172
- backward_op : conv2d_grad_grad
173 174
  forward : conv2d_grad (Tensor input, Tensor filter, Tensor grad_out,  int[] strides, int[] paddings, str padding_algorithm, int[] dilations, int groups, str data_format) -> Tensor(grad_input), Tensor(grad_filter)
  args : (Tensor input, Tensor filter, Tensor grad_out, Tensor grad_input_grad, Tensor grad_filter_grad, int[] strides, int[] paddings, str padding_algorithm, int[] dilations, int groups, str data_format)
Z
zyfncg 已提交
175 176 177 178 179
  output : Tensor(input_grad), Tensor(filter_grad), Tensor(grad_out_grad)
  infer_meta :
    func : GeneralTernaryGradInferMeta
    param: [input, filter, grad_out]
  kernel :
180
    func : conv2d_double_grad
Z
zyfncg 已提交
181 182
  optional : grad_input_grad, grad_filter_grad

183
- backward_op : conv2d_transpose_double_grad
184 185
  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 已提交
186 187 188 189
  output : Tensor(x_grad), Tensor(filter_grad), Tensor(grad_out_grad)
  infer_meta :
    func : Conv2dTransposeDoubleGradInferMeta
  kernel :
190
    func : conv2d_transpose_double_grad
Z
zyfncg 已提交
191

192
- backward_op : conv2d_transpose_grad
193 194
  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 已提交
195 196
  output : Tensor(x_grad), Tensor(filter_grad)
  infer_meta :
197
    func : Conv2dTransposeGradInferMeta
Z
zyfncg 已提交
198 199 200 201
  kernel :
    func : conv2d_transpose_grad
  backward : conv2d_transpose_double_grad

202 203 204 205 206 207 208 209 210 211 212
- backward_op : conv3d_double_grad
  forward : conv3d_grad (Tensor input, Tensor filter, Tensor grad_out,  int[] strides, int[] paddings, str padding_algorithm, int groups, int[] dilations, str data_format) -> Tensor(grad_input), Tensor(grad_filter)
  args : (Tensor input, Tensor filter, Tensor grad_out, Tensor grad_input_grad, Tensor grad_filter_grad, int[] strides, int[] paddings, str padding_algorithm, int groups, int[] dilations, str data_format)
  output : Tensor(input_grad), Tensor(filter_grad), Tensor(grad_out_grad)
  infer_meta :
    func : GeneralTernaryGradInferMeta
    param: [input, filter, grad_out]
  kernel :
    func : conv3d_double_grad
  optional : grad_input_grad, grad_filter_grad

213
- backward_op : conv3d_grad
214 215
  forward : conv3d (Tensor input, Tensor filter, int[] strides, int[] paddings, str padding_algorithm, int groups, int[] dilations, str data_format) -> Tensor(out)
  args : (Tensor input, Tensor filter, Tensor out_grad,  int[] strides, int[] paddings, str padding_algorithm, int groups, int[] dilations, str data_format)
Z
zyfncg 已提交
216
  output : Tensor(input_grad), Tensor(filter_grad)
Z
zyfncg 已提交
217 218 219 220 221
  infer_meta :
    func : GeneralBinaryGradInferMeta
    param : [input, filter]
  kernel :
    func : conv3d_grad
222
  backward : conv3d_double_grad
Z
zyfncg 已提交
223

224
- backward_op : conv3d_transpose_grad
Z
zyfncg 已提交
225 226 227 228 229 230 231 232
  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

233
- backward_op : cumsum_grad
W
WangZhen 已提交
234
  forward : cumsum(Tensor x, Scalar axis, bool flatten, bool exclusive, bool reverse) -> Tensor(out)
235
  args : (Tensor x, Tensor out_grad, Scalar axis, bool flatten, bool exclusive, bool reverse)
Z
zyfncg 已提交
236
  output : Tensor(x_grad)
237 238 239 240 241 242
  infer_meta :
    func : UnchangedInferMeta
    param: [x]
  kernel :
    func : cumsum_grad
    data_type: x
G
GGBond8488 已提交
243
  composite: cumsum_grad(x, out_grad, axis, flatten, exclusive, reverse, x_grad)
Z
zyfncg 已提交
244

245
- backward_op : deformable_conv_grad
Z
zyfncg 已提交
246 247 248 249 250 251 252 253 254 255
  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

256
- backward_op : depthwise_conv2d_double_grad
257
  forward : depthwise_conv2d_grad (Tensor input, Tensor filter, Tensor grad_out, int[] strides, int[] paddings, str padding_algorithm, int groups, int[] dilations, str data_format) -> Tensor(grad_input), Tensor(grad_filter)
258 259 260 261 262 263 264 265 266
  args : (Tensor input, Tensor filter, Tensor grad_out, Tensor grad_input_grad, Tensor grad_filter_grad, int[] strides, int[] paddings, str padding_algorithm, int groups, int[] dilations, str data_format)
  output : Tensor(input_grad), Tensor(filter_grad), Tensor(grad_out_grad)
  infer_meta :
    func : GeneralTernaryGradInferMeta
    param: [input, filter, grad_out]
  kernel :
    func : depthwise_conv2d_double_grad
  optional : grad_input_grad, grad_filter_grad

267
- backward_op : depthwise_conv2d_grad
268 269
  forward : depthwise_conv2d (Tensor input, Tensor filter, int[] strides, int[] paddings, str padding_algorithm, int groups, int[] dilations, str data_format) -> Tensor(out)
  args : (Tensor input, Tensor filter, Tensor out_grad, int[] strides, int[] paddings, str padding_algorithm, int groups, int[] dilations, str data_format)
Z
zyfncg 已提交
270 271 272 273 274 275
  output : Tensor(input_grad), Tensor(filter_grad)
  infer_meta :
    func : GeneralBinaryGradInferMeta
    param : [input, filter]
  kernel :
    func : depthwise_conv2d_grad
276 277
    param : [input, filter, out_grad, strides, paddings, padding_algorithm, groups, dilations, data_format]
  backward : depthwise_conv2d_double_grad
Z
zyfncg 已提交
278

279
- backward_op : depthwise_conv2d_transpose_grad
280 281
  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 已提交
282 283
  output : Tensor(x_grad), Tensor(filter_grad)
  infer_meta :
284
    func : Conv2dTransposeGradInferMeta
Z
zyfncg 已提交
285 286 287
  kernel :
    func : depthwise_conv2d_transpose_grad

288
- backward_op : divide_double_grad
Z
zyfncg 已提交
289 290 291 292 293 294 295 296 297 298 299 300
  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)

301
- backward_op : divide_grad
Z
zyfncg 已提交
302 303 304 305 306 307 308 309
  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
310
  composite : divide_grad(x, y, out, out_grad, axis, x_grad, y_grad)
Z
zyfncg 已提交
311 312
  backward : divide_double_grad

313
- backward_op : dropout_grad
314 315
  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 已提交
316 317 318 319 320 321 322
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [out_grad]
  kernel :
    func : dropout_grad

323
- backward_op : einsum_grad
Z
zyfncg 已提交
324 325 326 327 328 329 330 331 332
  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

333
- backward_op : elementwise_pow_grad
Z
zyfncg 已提交
334 335 336 337 338 339
  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]
340
  composite : elementwise_pow_grad(x, y, out_grad, axis, x_grad, y_grad)
Z
zyfncg 已提交
341 342 343
  kernel :
    func : elementwise_pow_grad

344
- backward_op : embedding_grad
Z
zyfncg 已提交
345 346 347 348
  forward : embedding (Tensor x, Tensor weight, int64_t padding_idx=-1, bool sparse=false) -> Tensor(out)
  args : (Tensor x, Tensor weight, Tensor out_grad, int64_t padding_idx=-1, bool sparse=false)
  output : Tensor(weight_grad)
  invoke : embedding_grad_impl(x, weight, out_grad, padding_idx, sparse, weight_grad)
W
wanghuancoder 已提交
349
  no_need_buffer : weight
Z
zyfncg 已提交
350

351
- backward_op : expand_as_grad
Z
zyfncg 已提交
352 353 354 355 356 357 358 359 360 361
  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

362
- backward_op : expand_double_grad
Z
zyfncg 已提交
363 364 365
  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)
366
  invoke : expand(grad_x_grad, shape)
Z
zyfncg 已提交
367

368
- backward_op : expand_grad
Z
zyfncg 已提交
369 370 371 372 373 374 375 376 377 378
  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
379
  composite: expand_grad(x, out_grad, shape, x_grad)
Z
zyfncg 已提交
380

381
- backward_op : exponential__grad
382
  forward : exponential_ (Tensor x, float lam) -> Tensor(out)
383 384 385 386
  args : (Tensor out_grad)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
387
  invoke : zeros_like(out_grad)
388

389
- backward_op : fill_grad
390 391 392 393 394 395 396 397 398 399
  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)

400
- backward_op : fmax_grad
401
  forward : fmax(Tensor x, Tensor y) -> Tensor(out)
Z
zhangyuqin1998 已提交
402
  args : (Tensor x, Tensor y, Tensor out_grad)
Z
zyfncg 已提交
403 404 405 406 407 408 409
  output : Tensor(x_grad), Tensor(y_grad)
  infer_meta :
    func : GeneralBinaryGradInferMeta
    param: [x, y]
  kernel :
    func : fmax_grad

410
- backward_op : fmin_grad
411
  forward : fmin(Tensor x, Tensor y) -> Tensor(out)
Z
zyfncg 已提交
412
  args : (Tensor x, Tensor y, Tensor out_grad)
Z
zyfncg 已提交
413 414 415 416 417 418 419
  output : Tensor(x_grad), Tensor(y_grad)
  infer_meta :
    func : GeneralBinaryGradInferMeta
    param: [x, y]
  kernel :
    func : fmin_grad

420
- backward_op : frobenius_norm_grad
Z
zyfncg 已提交
421 422 423 424 425 426 427 428 429
  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

430
- backward_op : gather_grad
Z
zyfncg 已提交
431 432 433 434 435 436 437 438 439
  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
440
  composite : gather_grad(x, index, out_grad, axis, overwrite, x_grad)
Z
zyfncg 已提交
441 442
  no_need_buffer : x

443
- backward_op : group_norm_grad
Z
zyfncg 已提交
444 445 446 447 448 449 450 451 452 453 454 455
  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)

456
- backward_op : hardswish_grad
457
  forward : hardswish (Tensor x) -> Tensor(out)
458
  args : (Tensor x, Tensor out_grad)
Z
zyfncg 已提交
459 460 461 462 463
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
Z
zyfncg 已提交
464
    func : hardswish_grad
Z
zyfncg 已提交
465 466
  inplace : (out_grad -> x_grad)

467 468 469 470 471 472 473 474 475 476
- backward_op : heaviside_grad
  forward : heaviside (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 : heaviside_grad

477
- backward_op : hsigmoid_loss_grad
478 479
  forward : hsigmoid_loss (Tensor x, Tensor label, Tensor w, Tensor bias, Tensor path, Tensor code, int num_classes, bool remote_prefetch, bool is_sparse) -> Tensor(out), Tensor(pre_out), Tensor(w_out)
  args : (Tensor x, Tensor w, Tensor label, Tensor path, Tensor code, Tensor bias, Tensor pre_out, Tensor out_grad, int num_classes, bool remote_prefetch, bool is_sparse)
480 481 482 483 484 485
  output : Tensor(x_grad), Tensor(w_grad), Tensor(bias_grad)
  infer_meta :
    func : GeneralTernaryGradInferMeta
    param : [x ,w, bias]
  optional: path, code, bias
  kernel :
486
    func : hsigmoid_loss_grad
487

488
- backward_op : instance_norm_double_grad
Z
zyfncg 已提交
489 490 491 492 493 494 495 496 497 498
  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

499
- backward_op : instance_norm_grad
Z
zyfncg 已提交
500 501 502 503 504 505 506 507 508 509 510
  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

511
- backward_op : layer_norm_grad
512 513
  forward : layer_norm (Tensor x, Tensor scale, Tensor bias, float epsilon, int begin_norm_axis) -> Tensor(out), Tensor(mean), Tensor(variance)
  args : (Tensor x,  Tensor scale, Tensor bias, Tensor mean, Tensor variance, Tensor out_grad, float epsilon, int begin_norm_axis)
Z
zyfncg 已提交
514 515 516 517 518 519 520
  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
521
  composite : layer_norm_grad(x, scale, bias, mean,varience, out_grad, epsilon, begin_norm_axis, x_grad, scale_grad, bias_grad)
Z
zyfncg 已提交
522 523 524
  no_need_buffer : bias
  optional : scale, bias

525
- backward_op : logsumexp_grad
Z
zyfncg 已提交
526 527 528 529 530 531 532 533 534
  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

535
- backward_op : lu_grad
L
Lin Manhui 已提交
536 537 538 539 540 541 542 543
  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

544
- backward_op : matmul_double_grad
Z
zyfncg 已提交
545 546 547 548 549 550 551 552
  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
553
  composite : matmul_double_grad(x, y, grad_out, grad_x_grad, grad_y_grad, transpose_x=false, transpose_y=false)
Z
zyfncg 已提交
554 555
  optional : grad_x_grad, grad_y_grad

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

567
- backward_op : max_grad
568 569
  forward: max (Tensor x,  IntArray axis={},  bool keepdim=false) -> Tensor(out)
  args : (Tensor x, Tensor out, Tensor out_grad, IntArray axis={}, bool keepdim=false, bool reduce_all=false)
Z
zyfncg 已提交
570 571 572 573 574 575
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param: [x]
  kernel :
    func : max_grad
576
  composite : max_grad(x, out, out_grad, axis, keepdim, reduce_all, x_grad)
Z
zyfncg 已提交
577

578
- backward_op : max_pool2d_with_index_grad
Z
zyfncg 已提交
579 580 581 582 583 584 585 586
  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

587
- backward_op : max_pool3d_with_index_grad
Z
zyfncg 已提交
588 589 590 591 592 593 594 595
  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

596
- backward_op : maximum_grad
Z
zyfncg 已提交
597 598 599 600 601 602 603 604
  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
H
heyanru 已提交
605
  composite : maximum_grad(x, y, out_grad, axis, x_grad, y_grad)
Z
zyfncg 已提交
606

607
- backward_op : mean_all_grad
Z
zyfncg 已提交
608 609 610 611 612 613 614 615 616
  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

617
- backward_op : mean_double_grad
618 619
  forward: mean_grad (Tensor x, Tensor grad_out, IntArray axis={},  bool keepdim=false, bool reduce_all = false) -> Tensor(grad_x)
  args : (Tensor grad_x_grad, IntArray axis={},  bool keepdim=false)
Z
zyfncg 已提交
620
  output : Tensor(grad_out_grad)
621
  invoke : mean(grad_x_grad, axis, keepdim)
Z
zyfncg 已提交
622

623
- backward_op : mean_grad
624 625
  forward: mean (Tensor x,  IntArray axis={},  bool keepdim=false) -> Tensor(out)
  args : (Tensor x, Tensor out_grad, IntArray axis={},  bool keepdim=false, bool reduce_all=false)
Z
zyfncg 已提交
626 627 628 629 630 631 632 633 634
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param: [x]
  kernel :
    func : mean_grad
  backward : mean_double_grad
  no_need_buffer : x

635
- backward_op : min_grad
636 637
  forward: min (Tensor x,  IntArray axis={},  bool keepdim=false) -> Tensor(out)
  args : (Tensor x, Tensor out, Tensor out_grad, IntArray axis={}, bool keepdim=false, bool reduce_all=false)
Z
zyfncg 已提交
638 639 640 641 642 643 644
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param: [x]
  kernel :
    func : min_grad

645
- backward_op : minimum_grad
Z
zyfncg 已提交
646 647 648 649 650 651 652 653 654
  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

655
- backward_op : mish_grad
Z
zyfncg 已提交
656 657 658 659 660 661 662 663 664 665
  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)

666
- backward_op : multiply_double_grad
Z
zyfncg 已提交
667 668 669 670 671 672 673 674 675 676 677 678
  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)

679
- backward_op : multiply_grad
Z
zyfncg 已提交
680 681 682 683 684 685 686 687
  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
688
  composite: multiply_grad(x, y, out_grad, axis, x_grad, y_grad)
Z
zyfncg 已提交
689 690
  backward : multiply_double_grad

691
- backward_op : multiply_triple_grad
Z
zyfncg 已提交
692 693 694 695 696
  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
697
    param : [x, y, fwd_grad_out, fwd_grad_grad_x, fwd_grad_grad_y]
Z
zyfncg 已提交
698 699
  kernel :
    func : multiply_triple_grad
700
  optional : fwd_grad_grad_x, fwd_grad_grad_y, grad_x_grad, grad_y_grad, grad_grad_out_grad
Z
zyfncg 已提交
701

702
- backward_op : norm_grad
Z
zyfncg 已提交
703 704 705 706 707 708 709 710 711
  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

712
- backward_op : pad3d_double_grad
Z
zyfncg 已提交
713 714 715 716 717 718 719 720
  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

721
- backward_op : pad3d_grad
Z
zyfncg 已提交
722 723 724 725 726 727 728 729 730 731 732
  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

733
- backward_op : pad_double_grad
734 735
  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 已提交
736 737 738 739 740 741
  output : Tensor(grad_out_grad)
  infer_meta :
    func : PadInferMeta
  kernel :
    func : pad

742
- backward_op : pad_grad
743 744
  forward : pad(Tensor x, int[] paddings, Scalar pad_value) -> Tensor(out)
  args : (Tensor x, Tensor out_grad, int[] paddings, Scalar pad_value)
Z
zyfncg 已提交
745 746 747 748 749 750 751 752 753 754
  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

755
- backward_op : pool2d_double_grad
756 757
  forward : pool2d_grad(Tensor x, Tensor out, Tensor grad_out, IntArray kernel_size, int[] strides, int[] paddings, bool ceil_mode, bool exclusive, str data_format, str pooling_type, bool global_pooling, bool adaptive, str padding_algorithm) -> Tensor(grad_x)
  args : (Tensor x, Tensor grad_x_grad, IntArray kernel_size, int[] strides, int[] paddings, bool ceil_mode, bool exclusive, str data_format, str pooling_type, bool global_pooling, bool adaptive, str padding_algorithm)
Z
zyfncg 已提交
758 759
  output : Tensor(grad_out_grad)
  infer_meta :
760
    func : Pool2DInferMeta
761
    param : [grad_x_grad, kernel_size, strides, paddings, ceil_mode, exclusive, data_format, pooling_type, global_pooling, adaptive, padding_algorithm]
Z
zyfncg 已提交
762 763
  kernel :
    func : pool2d_double_grad
764
    param : [grad_x_grad, kernel_size, strides, paddings, ceil_mode, exclusive, data_format, pooling_type, global_pooling, adaptive, padding_algorithm]
765
  no_need_buffer : x
Z
zyfncg 已提交
766

767
- backward_op : pool2d_grad
768 769
  forward : pool2d(Tensor x, IntArray kernel_size, int[] strides, int[] paddings, bool ceil_mode, bool exclusive, str data_format, str pooling_type, bool global_pooling, bool adaptive, str padding_algorithm) -> Tensor(out)
  args : (Tensor x, Tensor out, Tensor out_grad, IntArray kernel_size, int[] strides, int[] paddings, bool ceil_mode, bool exclusive, str data_format, str pooling_type, bool global_pooling, bool adaptive, str padding_algorithm)
Z
zyfncg 已提交
770 771
  output : Tensor(x_grad)
  infer_meta :
772 773
    func : UnchangedInferMeta
    param: [x]
Z
zyfncg 已提交
774 775
  kernel :
    func : pool2d_grad
776
    param : [x, out, out_grad, kernel_size, strides, paddings, ceil_mode, exclusive, data_format, pooling_type, global_pooling, adaptive, padding_algorithm]
Z
zyfncg 已提交
777 778
  backward : pool2d_double_grad

779
- backward_op : pool3d_grad
780 781
  forward : pool3d(Tensor x, int[] kernel_size, int[] strides, int[] paddings, bool ceil_mode, bool exclusive, str data_format, str pooling_type, bool global_pooling, bool adaptive, str padding_algorithm) -> Tensor(out)
  args : (Tensor x, Tensor out, Tensor out_grad, int[] kernel_size, int[] strides, int[] paddings, bool ceil_mode, bool exclusive, str data_format, str pooling_type, bool global_pooling, bool adaptive, str padding_algorithm)
Z
zyfncg 已提交
782 783
  output : Tensor(x_grad)
  infer_meta :
784 785
    func : UnchangedInferMeta
    param: [x]
Z
zyfncg 已提交
786 787
  kernel :
    func : pool3d_grad
788
    param : [x, out, out_grad, kernel_size, strides, paddings, ceil_mode, exclusive, data_format, pooling_type, global_pooling, adaptive, padding_algorithm]
Z
zyfncg 已提交
789

790 791 792 793 794 795 796 797 798
- backward_op : prod_grad
  forward : prod (Tensor x, IntArray dims, bool keep_dim, bool reduce_all) -> Tensor(out)
  args : (Tensor x, Tensor out, Tensor out_grad, IntArray dims,  bool keep_dim, bool reduce_all)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : prod_grad
799
  composite: prod_grad(x, out, out_grad, dims, keep_dim, reduce_all, x_grad)
800

801
- backward_op : psroi_pool_grad
Z
zyfncg 已提交
802 803 804 805 806 807 808 809 810 811 812
  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

813
- backward_op : relu6_grad
814 815
  forward : relu6 (Tensor x) -> Tensor(out)
  args : (Tensor out, Tensor out_grad, float threshold = 6)
816 817 818 819 820 821 822 823
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [out]
  kernel :
    func : relu6_grad
  inplace : (out_grad -> x_grad)

824
- backward_op : repeat_interleave_grad
825 826
  forward : repeat_interleave(Tensor x, int repeats, int axis) -> Tensor(out)
  args : (Tensor x, Tensor out_grad, int repeats, int axis)
S
seemingwang 已提交
827 828 829 830 831 832 833
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : repeat_interleave_grad

834
- backward_op : repeat_interleave_with_tensor_index_grad
835 836
  forward : repeat_interleave_with_tensor_index(Tensor x, Tensor repeats, int axis) -> Tensor(out)
  args : (Tensor x, Tensor repeats, Tensor out_grad, int axis)
S
seemingwang 已提交
837 838 839 840 841 842 843 844
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : repeat_interleave_with_tensor_index_grad
    data_type : x

845
- backward_op : reshape_double_grad
Z
zyfncg 已提交
846 847 848 849 850 851 852 853 854 855 856
  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)

857
- backward_op : reshape_grad
Z
zyfncg 已提交
858 859 860 861 862 863 864 865 866 867 868 869 870 871 872
  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)

Y
YuanRisheng 已提交
873 874 875 876 877 878 879 880 881 882 883 884
- backward_op : rnn_grad
  forward : rnn (Tensor x, Tensor[] pre_state, Tensor[] weight_list, Tensor sequence_length, Tensor dropout_state_in, float dropout_prob, bool is_bidirec, int input_size, int hidden_size, int num_layers, str mode, int seed, bool is_test) -> Tensor(out), Tensor(dropout_state_out), Tensor[](state), Tensor(reserve)
  args : (Tensor x, Tensor[] pre_state, Tensor[] weight_list, Tensor sequence_length, Tensor out, Tensor dropout_state_out, Tensor reserve, Tensor out_grad, Tensor[] state_grad, float dropout_prob, bool is_bidirec, int input_size, int hidden_size, int num_layers, str mode, int seed, bool is_test)
  output : Tensor(x_grad), Tensor[](pre_state_grad){pre_state.size()}, Tensor[](weight_list_grad){weight_list.size()}
  infer_meta :
    func : RnnGradInferMeta
    param : [x, pre_state, weight_list]
  kernel :
    func : rnn_grad
    data_type: out_grad
  optional : sequence_length

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

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

W
Weilong Wu 已提交
910 911 912 913 914 915 916 917 918 919 920
- backward_op : rrelu_grad
  forward : rrelu (Tensor x, float lower, float upper, bool is_test) -> Tensor(out), Tensor(noise)
  args : (Tensor x, Tensor noise, Tensor out_grad)
  output : Tensor(x_grad)
  infer_meta :
    func : RReluGradInferMeta
    param : [out_grad, noise]
  kernel :
    func : rrelu_grad
    data_type : x

921
- backward_op : slice_double_grad
922 923 924
  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)
925
  invoke : slice(grad_input_grad, axes, starts, ends, infer_flags, decrease_axis)
926

927
- backward_op : slice_grad
Z
zyfncg 已提交
928 929 930 931 932 933 934 935
  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
936
  composite: slice_grad(input, out_grad, axes, starts, ends, infer_flags, decrease_axis, input_grad)
937
  backward : slice_double_grad
Z
zyfncg 已提交
938 939
  no_need_buffer : input

940
- backward_op : softmax_grad
Z
zyfncg 已提交
941 942 943 944 945 946 947 948
  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
949
  composite : softmax_grad(out, out_grad, axis, x_grad)
Z
zyfncg 已提交
950

951
- backward_op : split_grad
Z
zyfncg 已提交
952 953 954 955
  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)
956
  composite : split_grad(out_grad, axis, x_grad)
C
Charles-hit 已提交
957

958
- backward_op : split_with_num_grad
C
Charles-hit 已提交
959 960 961 962
  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)
963
  composite : split_grad(out_grad, axis, x_grad)
Z
zyfncg 已提交
964

965
- backward_op : squared_l2_norm_grad
966 967 968 969 970 971 972 973 974
  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

975
- backward_op : strided_slice_grad
Z
zyfncg 已提交
976 977 978 979 980 981 982 983 984 985
  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

986
- backward_op : subtract_double_grad
Z
zyfncg 已提交
987 988 989 990 991 992 993 994 995 996 997 998
  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)

999
- backward_op : subtract_grad
Z
zyfncg 已提交
1000 1001 1002 1003 1004 1005 1006 1007 1008
  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
1009
  composite : subtract_grad(x, y, out_grad, axis, x_grad, y_grad)
Z
zyfncg 已提交
1010 1011 1012
  backward : subtract_double_grad
  inplace : (out_grad -> x_grad)

1013
- backward_op : sum_double_grad
1014 1015
  forward : sum_grad (Tensor x, Tensor grad_out, IntArray axis, bool keepdim, bool reduce_all=false) -> Tensor(grad_x)
  args : (Tensor grad_x_grad, IntArray axis={}, bool keepdim=false)
Z
zyfncg 已提交
1016
  output : Tensor(grad_out_grad)
1017
  invoke : sum(grad_x_grad, axis, grad_x_grad.dtype(), keepdim)
Z
zyfncg 已提交
1018

1019
- backward_op : sum_grad
1020 1021
  forward : sum (Tensor x, IntArray axis={}, DataType dtype=DataType::UNDEFINED, bool keepdim=false) -> Tensor(out)
  args : (Tensor x, Tensor out_grad, IntArray axis, bool keepdim, bool reduce_all=false)
Z
zyfncg 已提交
1022 1023 1024 1025 1026 1027
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : sum_grad
1028
  composite : sum_grad(x, out_grad, axis, keepdim, reduce_all, x_grad)
Z
zyfncg 已提交
1029 1030 1031
  no_need_buffer : x
  backward : sum_double_grad

1032
- backward_op : swish_grad
1033
  forward : swish (Tensor x) -> Tensor(out)
Z
zyfncg 已提交
1034 1035 1036 1037 1038 1039 1040 1041 1042
  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)

1043
- backward_op : sync_batch_norm_grad
1044 1045
  forward : sync_batch_norm_ (Tensor x, Tensor mean, Tensor variance, Tensor scale, Tensor bias, bool is_test, float momentum, float epsilon, str data_layout, bool use_global_stats, bool trainable_statistics) -> Tensor(out), Tensor(mean_out), Tensor(variance_out), Tensor(saved_mean), Tensor(saved_variance), Tensor(reserve_space)
  args : (Tensor x, Tensor scale, Tensor bias, Tensor saved_mean, Tensor saved_variance, Tensor reserve_space, Tensor out_grad, float momentum, float epsilon, str data_layout, bool is_test, bool use_global_stats, bool trainable_statistics)
1046 1047 1048 1049 1050 1051 1052
  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
1053
  optional : reserve_space
1054

1055
- backward_op : temporal_shift_grad
C
ccrrong 已提交
1056 1057 1058 1059 1060 1061 1062 1063 1064
  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

1065
- backward_op : tile_double_grad
Z
zyfncg 已提交
1066 1067 1068
  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)
1069
  invoke : tile(grad_x_grad, repeat_times)
Z
zyfncg 已提交
1070

1071
- backward_op : tile_grad
Z
zyfncg 已提交
1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082
  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

1083
- backward_op : transpose_double_grad
1084 1085
  forward : transpose_grad (Tensor grad_out, int[] perm) -> Tensor(grad_x)
  args : (Tensor grad_x_grad, int[] perm)
Z
zyfncg 已提交
1086
  output : Tensor(grad_out_grad)
1087
  invoke : transpose(grad_x_grad, perm)
Z
zyfncg 已提交
1088

1089
- backward_op : transpose_grad
1090 1091
  forward : transpose (Tensor x, int[] perm) -> Tensor(out)
  args : (Tensor out_grad, int[] perm)
Z
zyfncg 已提交
1092 1093 1094
  output : Tensor(x_grad)
  infer_meta :
    func : TransposeGradInferMeta
1095
    param : [out_grad, perm]
Z
zyfncg 已提交
1096 1097 1098
  kernel :
    func : transpose_grad
  backward : transpose_double_grad
1099
  composite: transpose_grad(out_grad, perm, x_grad)
Z
zyfncg 已提交
1100

1101
- backward_op : triangular_solve_grad
Z
zyfncg 已提交
1102 1103 1104 1105 1106 1107 1108 1109 1110
  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

1111
- backward_op : tril_grad
1112 1113
  forward : tril(Tensor x,  int diagonal) -> Tensor(out)
  args : (Tensor out_grad,  int diagonal)
Z
zyfncg 已提交
1114 1115 1116 1117 1118
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [out_grad]
  kernel :
1119
    func : tril_grad
Z
zyfncg 已提交
1120

1121 1122 1123 1124 1125 1126 1127 1128 1129 1130
- backward_op : triu_grad
  forward : triu(Tensor x,  int diagonal) -> Tensor(out)
  args : (Tensor out_grad,  int diagonal)
  output : Tensor(x_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [out_grad]
  kernel :
    func : triu_grad

1131 1132
- backward_op : uniform_inplace_grad
  forward : uniform_inplace(Tensor x, float min, float max, int seed, int diag_num, int diag_step, float diag_val) -> Tensor(out)
1133 1134 1135 1136 1137
  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 :
1138
    func : uniform_inplace_grad
1139 1140
  inplace : (out_grad -> x_grad)

1141 1142
- backward_op : yolo_loss_grad
  forward : yolo_loss(Tensor x, Tensor gt_box, Tensor gt_label, Tensor gt_score, int[] anchors, int[] anchor_mask, int class_num, float ignore_thresh, int downsample_ratio, bool use_label_smooth=true, float scale_x_y=1.0) -> Tensor(loss), Tensor(objectness_mask), Tensor(gt_match_mask)
1143 1144 1145
  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 :
1146
    func : YoloLossGradInferMeta
1147
  kernel :
1148
    func : yolo_loss_grad
1149
  optional : gt_score
X
xiaoting 已提交
1150

1151
- backward_op: unpool3d_grad
X
xiaoting 已提交
1152 1153 1154 1155 1156 1157 1158 1159 1160 1161
  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

1162
- backward_op: unpool_grad
1163 1164
  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 已提交
1165 1166 1167 1168 1169 1170 1171
  output: Tensor(x_grad)
  infer_meta:
    func: UnchangedInferMeta
    param : [x]
  kernel:
    func: unpool_grad
    data_type: x