legacy_ops.yaml 31.3 KB
Newer Older
1
# The apis in this file are unstandardized that may caused by a variety of reasons,
C
Chen Weihang 已提交
2
# we are trying to fix these apis and will move standardized apis into ops.yaml.
3

4
- op : adadelta_
5
  args : (Tensor param, Tensor grad, Tensor avg_squared_grad, Tensor avg_squared_update, Tensor learning_rate, Tensor master_param, float rho, float epsilon, bool multi_precision)
6
  output : Tensor(param_out), Tensor(moment_out), Tensor(inf_norm_out), Tensor(master_param_out)
Z
zyfncg 已提交
7 8 9 10
  infer_meta :
    func : AdadeltaInferMeta
  kernel :
    func : adadelta
11 12 13
    data_type : param
  optional : master_param
  inplace : (param -> param_out), (avg_squared_grad -> moment_out), (avg_squared_update -> inf_norm_out), (master_param -> master_param_out)
Z
zyfncg 已提交
14

15
- op : add
Z
zyfncg 已提交
16
  args : (Tensor x, Tensor y)
17
  output : Tensor(out)
Z
zyfncg 已提交
18 19 20 21
  infer_meta :
    func : ElementwiseInferMeta
  kernel :
    func : add
22
  inplace : (x -> out)
Z
zyfncg 已提交
23 24
  backward : add_grad

25
- op : add_n
26
  args : (Tensor[] inputs)
Z
zyfncg 已提交
27
  output : Tensor
28
  invoke : add_n_impl(inputs)
Z
zyfncg 已提交
29 30
  backward : add_n_grad

31
- op : all
32
  args : (Tensor x, int64_t[] axis={}, bool keepdim=false)
Z
zyfncg 已提交
33 34 35 36 37 38
  output : Tensor(out)
  infer_meta :
    func : ReduceInferMeta
  kernel :
    func : all

39
- op : amax
40
  args : (Tensor x, int64_t[] axis={}, bool keepdim=false)
41 42 43 44 45 46 47
  output : Tensor(out)
  infer_meta :
    func : ReduceInferMeta
  kernel :
    func : amax
  backward : amax_grad

48
- op : amin
49
  args : (Tensor x, int64_t[] axis={}, bool keepdim=false)
50 51 52 53 54 55 56
  output : Tensor(out)
  infer_meta :
    func : ReduceInferMeta
  kernel :
    func : amin
  backward : amin_grad

57
- op : any
58
  args : (Tensor x, int64_t[] axis={}, bool keepdim=false)
Z
zyfncg 已提交
59 60 61 62 63 64
  output : Tensor(out)
  infer_meta :
    func : ReduceInferMeta
  kernel :
    func : any

65
- op : arange
Z
zyfncg 已提交
66
  args : (Tensor start, Tensor end, Tensor step, DataType dtype, Place place={})
67
  output : Tensor(out)
Z
zyfncg 已提交
68 69 70 71 72 73 74 75 76 77 78
  infer_meta :
    func : ArangeInferMeta
    param : [start, end, step]
  kernel :
    func : arange
    param : [start, end, step]
    data_type : dtype
    backend : place
  data_transform :
    support_trans_dtype : start, end, step

79
- op : assign
Z
zyfncg 已提交
80 81 82 83 84 85 86 87
  args : (Tensor x)
  output : Tensor
  infer_meta :
    func : UnchangedInferMeta
  kernel :
    func : assign
  backward : assign_grad

88
- op : assign_out_
Z
zyfncg 已提交
89 90 91 92 93 94 95 96 97 98 99
  args : (Tensor x, Tensor output)
  output : Tensor(out)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : assign
    param : [x]
  inplace : (output -> out)
  backward : assign_out__grad

100
- op : assign_value_
101 102 103 104 105 106 107 108 109 110
  args : (Tensor output, int[] shape, DataType dtype, Scalar[] values, Place place = {})
  output : Tensor(out)
  inplace: (output -> out)
  infer_meta :
    func : AssignValueInferMeta
    param : [shape, dtype]
  kernel :
    func : assign_value
    param : [shape, dtype, values]
    data_type : dtype
111
    backend : place > output
112

113
- op : batch_norm
114
  args : (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)
Z
zyfncg 已提交
115
  output : Tensor(out), Tensor(mean_out), Tensor(variance_out), Tensor(saved_mean), Tensor(saved_variance), Tensor(reserve_space)
116 117 118 119 120 121
  infer_meta:
    func : BatchNormInferMeta
  kernel :
    func : batch_norm
    data_type : x
  view : (mean -> mean_out), (variance -> variance_out)
Z
zyfncg 已提交
122 123
  backward : batch_norm_grad

124
- op : bincount
125
  args: (Tensor x, Tensor weights, Scalar(int) minlength = 0)
126 127 128 129 130 131 132
  output: Tensor(out)
  infer_meta:
    func: BincountInferMeta
  kernel:
    func: bincount
  optional: weights

133
- op : cast
134
  args : (Tensor x, DataType dtype)
Z
zyfncg 已提交
135 136 137 138 139
  output : Tensor
  infer_meta :
    func : CastInferMeta
  kernel :
    func : cast
140
    param : [x, dtype]
Z
zyfncg 已提交
141 142 143
    data_type : x
  backward : cast_grad

144 145 146 147 148 149 150 151 152
- op : channel_shuffle
  args : (Tensor x, int groups, str data_format="NCHW")
  output : Tensor(out)
  infer_meta :
    func : ChannelShuffleInferMeta
  kernel :
    func : channel_shuffle
  backward : channel_shuffle_grad

153 154 155 156 157 158 159 160 161 162 163 164
- op : check_finite_and_unscale_
  args : (Tensor[] x, Tensor scale, Tensor input_found_infinite)
  output : Tensor[](out){x.size()}, Tensor(output_found_infinite)
  infer_meta :
    func : CheckFiniteAndUnscaleInferMeta
    param : [x, scale]
  kernel :
    func : check_finite_and_unscale
    param : [x, scale]
    data_type : x
  inplace : (x -> out), (input_found_infinite -> output_found_infinite)

165
- op : concat
Z
zyfncg 已提交
166 167 168 169 170 171 172 173 174
  args : (Tensor[] x, Scalar(int64_t) axis)
  output : Tensor
  infer_meta :
    func : ConcatInferMeta
    param : [x, axis]
  kernel :
    func : concat
  backward : concat_grad

175
- op : conv2d
176
  args : (Tensor input, Tensor filter, int[] strides, int[] paddings, str padding_algorithm, int[] dilations, int groups, str data_format)
Z
zyfncg 已提交
177
  output : Tensor
Z
zyfncg 已提交
178 179 180 181
  infer_meta :
    func : ConvInferMeta
  kernel :
    func : conv2d
Z
zyfncg 已提交
182 183
  backward : conv2d_grad

184
- op : conv2d_transpose
185
  args : (Tensor x, Tensor filter, int[] strides, int[] paddings, int[] output_padding, IntArray output_size, str padding_algorithm, int groups, int[] dilations, str data_format)
Z
zyfncg 已提交
186 187
  output : Tensor(out)
  infer_meta :
188
    func : Conv2dTransposeInferMeta
Z
zyfncg 已提交
189 190 191 192
  kernel :
    func : conv2d_transpose
  backward : conv2d_transpose_grad

193
- op : conv3d
194
  args : (Tensor input, Tensor filter, int[] strides, int[] paddings, str padding_algorithm, int groups, int[] dilations, str data_format)
Z
zyfncg 已提交
195
  output : Tensor
Z
zyfncg 已提交
196
  infer_meta :
197
    func : Conv3DInferMeta
Z
zyfncg 已提交
198 199
  kernel :
    func : conv3d
Z
zyfncg 已提交
200 201
  backward : conv3d_grad

202
- op : conv3d_transpose
Z
zyfncg 已提交
203 204 205 206 207 208 209 210
  args : (Tensor x, Tensor filter, int[] strides, int[] paddings, int[] output_padding, int[] output_size, str padding_algorithm, int groups, int[] dilations, str data_format)
  output : Tensor(out)
  infer_meta :
    func : ConvTransposeInferMeta
  kernel :
    func : conv3d_transpose
  backward : conv3d_transpose_grad

211
- op : copy_to
Z
zyfncg 已提交
212
  args : (Tensor x, Place place, bool blocking)
213
  output : Tensor(out)
Z
zyfncg 已提交
214 215
  invoke : copy_to_impl(x, place, blocking)

216
- op : cumsum
W
WangZhen 已提交
217
  args : (Tensor x, Scalar axis, bool flatten, bool exclusive, bool reverse)
Z
zyfncg 已提交
218 219
  output : Tensor(out)
  infer_meta :
W
WangZhen 已提交
220
    func : CumScalarAxisInferMeta
Z
zyfncg 已提交
221 222 223 224
  kernel :
    func : cumsum
  backward : cumsum_grad

225
- op : decode_jpeg
Y
YuanRisheng 已提交
226
  args : (Tensor x, str mode, Place place)
W
wuyefeilin 已提交
227 228 229
  output : Tensor(out)
  infer_meta :
    func : DecodeJpegInferMeta
Y
YuanRisheng 已提交
230
    param : [x, mode]
W
wuyefeilin 已提交
231 232
  kernel :
    func : decode_jpeg
Y
YuanRisheng 已提交
233 234
    param : [x, mode]
    backend : place
W
wuyefeilin 已提交
235

236
- op : deformable_conv
Z
zyfncg 已提交
237 238 239 240 241 242 243 244 245 246
  args : (Tensor x, Tensor offset, Tensor filter, Tensor mask, int[] strides, int[] paddings, int[] dilations, int deformable_groups, int groups, int im2col_step)
  output : Tensor(out)
  infer_meta :
    func : DeformableConvInferMeta
  kernel :
    func : deformable_conv
    data_type : x
  optional : mask
  backward : deformable_conv_grad

247
- op : depthwise_conv2d
248
  args : (Tensor x, Tensor filter, int[] strides, int[] paddings, str padding_algorithm, int groups, int[] dilations, str data_format)
Z
zyfncg 已提交
249 250
  output : Tensor(out)
  infer_meta :
251
    func : DepthwiseConvInferMeta
252
    param : [x, filter, strides, paddings, padding_algorithm, groups, dilations, data_format]
Z
zyfncg 已提交
253 254
  kernel :
    func : depthwise_conv2d
255
    param : [x, filter, strides, paddings, padding_algorithm, groups, dilations, data_format]
Z
zyfncg 已提交
256 257
  backward : depthwise_conv2d_grad

258
- op : depthwise_conv2d_transpose
259
  args : (Tensor x, Tensor filter, int[] strides, int[] paddings, int[] output_padding, IntArray output_size, str padding_algorithm, int groups, int[] dilations, str data_format)
Z
zyfncg 已提交
260 261
  output : Tensor(out)
  infer_meta :
262
    func : Conv2dTransposeInferMeta
Z
zyfncg 已提交
263 264 265 266
  kernel :
    func : depthwise_conv2d_transpose
  backward : depthwise_conv2d_transpose_grad

267
- op : distribute_fpn_proposals
268 269 270 271 272 273 274 275 276
  args : (Tensor fpn_rois, Tensor rois_num, int min_level, int max_level, int refer_level, int refer_scale, bool pixel_offset)
  output : Tensor[](multi_fpn_rois){max_level - min_level + 1}, Tensor[](multi_level_rois_num){max_level - min_level + 1}, Tensor(restore_index)
  infer_meta :
    func : DistributeFpnProposalsInferMeta
  kernel :
    func : distribute_fpn_proposals
    data_type : fpn_rois
  optional : rois_num

277
- op : divide
Z
zyfncg 已提交
278 279 280 281 282 283 284 285
  args : (Tensor x, Tensor y)
  output : Tensor
  infer_meta :
    func : ElementwiseInferMeta
  kernel :
    func : divide
  backward : divide_grad

286
- op : dropout
287
  args : (Tensor x, Tensor seed_tensor, Scalar p, bool is_test, str mode, int seed, bool fix_seed)
Z
zyfncg 已提交
288 289 290 291 292 293 294 295 296
  output : Tensor(out), Tensor(mask)
  infer_meta :
    func : DropoutInferMeta
  kernel :
    func : dropout
    data_type : x
  optional : seed_tensor
  backward : dropout_grad

297
- op : einsum
Z
zyfncg 已提交
298 299 300
  args : (Tensor[] x, str equation)
  output : Tensor, Tensor[]{x.size()}, Tensor[]{x.size()}
  infer_meta :
301
    func : EinsumRawInferMeta
Z
zyfncg 已提交
302 303
    param : [x, equation]
  kernel :
304
    func : einsum
Z
zyfncg 已提交
305 306
  backward : einsum_grad

307
- op : elementwise_pow
Z
zyfncg 已提交
308 309 310 311 312 313 314 315
  args : (Tensor x, Tensor y)
  output : Tensor(out)
  infer_meta :
    func : ElementwiseInferMeta
  kernel :
    func : elementwise_pow
  backward : elementwise_pow_grad

316
- op : embedding
Z
zyfncg 已提交
317 318
  args : (Tensor x, Tensor weight, int64_t padding_idx=-1, bool sparse=false)
  output : Tensor
319 320 321 322 323 324 325 326
  infer_meta :
    func : EmbeddingInferMeta
    param : [x, weight, padding_idx]
  kernel :
    func : embedding {dense, dense -> dense}
           sparse_weight_embedding {dense, selected_rows -> dense}
    param : [x, weight, padding_idx]
    data_type : weight
Z
zyfncg 已提交
327 328
  backward : embedding_grad

329
- op : empty
Z
zyfncg 已提交
330
  args : (IntArray shape, DataType dtype=DataType::FLOAT32, Place place=CPUPlace())
331
  output: Tensor(out)
Z
zyfncg 已提交
332 333 334 335 336 337 338 339 340
  infer_meta :
    func : CreateInferMeta
    param : [shape, dtype]
  kernel :
    func : empty
    param : [shape, dtype]
    data_type : dtype
    backend : place

341
- op : empty_like
Z
zyfncg 已提交
342
  args : (Tensor x, DataType dtype = DataType::UNDEFINED, Place place = {})
343
  output: Tensor(out)
Z
zyfncg 已提交
344 345 346 347 348 349 350 351 352
  infer_meta :
    func : CreateLikeInferMeta
    param : [x, dtype]
  kernel :
    func : empty_like
    param : [x, dtype]
    data_type : dtype > x
    backend : place > x

353
- op : equal
354
  args : (Tensor x, Tensor y)
355
  output : Tensor(out)
Z
zyfncg 已提交
356 357 358 359 360
  infer_meta :
    func : CompareInferMeta
  kernel :
    func : equal

361
- op : expand
Z
zyfncg 已提交
362 363 364 365 366 367 368 369
  args : (Tensor x, IntArray shape)
  output : Tensor
  infer_meta :
    func : ExpandInferMeta
  kernel :
    func : expand
  backward : expand_grad

370
- op : exponential_
371
  args : (Tensor x, float lam)
372 373 374 375 376 377 378 379 380
  output : Tensor(out)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : exponential
  inplace : (x -> out)
  backward : exponential__grad

381
- op : eye
382
  args : (Scalar num_rows, Scalar num_columns, DataType dtype=DataType::FLOAT32, Place place={})
Z
zyfncg 已提交
383 384 385 386 387 388 389 390 391 392
  output : Tensor(out)
  infer_meta :
    func : EyeInferMeta
    param : [num_rows, num_columns, dtype]
  kernel :
    func : eye
    param : [num_rows, num_columns, dtype]
    data_type : dtype
    backend : place

393
- op : fill
394 395 396 397 398 399 400 401 402 403
  args : (Tensor x, Scalar value)
  output : Tensor(out)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : fill
  inplace : (x -> out)
  backward: fill_grad

404
- op : floor_divide
Z
zyfncg 已提交
405 406 407 408 409 410 411
  args : (Tensor x, Tensor y)
  output : Tensor(out)
  infer_meta :
    func : ElementwiseInferMeta
  kernel :
    func : floor_divide

412
- op : fmax
413
  args : (Tensor x, Tensor y)
Z
zyfncg 已提交
414 415 416 417 418 419 420 421
  output : Tensor(out)
  infer_meta :
    param: [x, y]
    func : ElementwiseInferMeta
  kernel :
    func : fmax
  backward : fmax_grad

422
- op : fmin
423
  args : (Tensor x, Tensor y)
Z
zyfncg 已提交
424 425 426 427 428 429 430 431
  output : Tensor(out)
  infer_meta :
    param: [x, y]
    func : ElementwiseInferMeta
  kernel :
    func : fmin
  backward : fmin_grad

432
- op : frobenius_norm
Z
zyfncg 已提交
433 434 435 436 437 438 439 440
  args : (Tensor x, int64_t[] axis,  bool keep_dim,  bool reduce_all)
  output : Tensor(out)
  infer_meta :
    func : ReduceInferMetaBase
  kernel :
    func : frobenius_norm
  backward : frobenius_norm_grad

441
- op : full
Z
zyfncg 已提交
442
  args : (IntArray shape, Scalar value, DataType dtype=DataType::FLOAT32, Place place=CPUPlace())
443
  output: Tensor(out)
Z
zyfncg 已提交
444 445 446 447 448 449 450 451 452
  infer_meta :
    func : CreateInferMeta
    param : [shape, dtype]
  kernel :
    func : full
    param : [shape, value, dtype]
    data_type : dtype
    backend : place

453
- op : full_
454 455 456 457 458 459 460 461 462 463 464 465
  args : (Tensor output, IntArray shape, Scalar value, DataType dtype=DataType::FLOAT32, Place place=CPUPlace())
  output : Tensor(out)
  inplace : (output -> out)
  infer_meta :
    func : CreateInferMeta
    param : [shape, dtype]
  kernel :
    func : full
    param : [shape, value, dtype]
    data_type : dtype
    backend : place

466
- op : full_batch_size_like
Z
zyfncg 已提交
467
  args : (Tensor input, int[] shape, DataType dtype, Scalar value, int input_dim_idx, int output_dim_idx, Place place=CPUPlace())
468
  output: Tensor(out)
Z
zyfncg 已提交
469 470 471 472 473 474 475 476 477
  infer_meta :
    func : FullBatchSizeLikeInferMeta
    param : [input, shape, value, dtype, input_dim_idx, output_dim_idx]
  kernel :
    func : full_batch_size_like
    param : [input, shape, value, dtype, input_dim_idx, output_dim_idx]
    data_type : dtype
    backend : place

478
- op : full_like
Z
zyfncg 已提交
479
  args : (Tensor x, Scalar value, DataType dtype = DataType::UNDEFINED, Place place = {})
480
  output: Tensor(out)
Z
zyfncg 已提交
481 482 483 484 485 486 487 488 489 490 491
  infer_meta :
    func : CreateLikeInferMeta
    param : [x, dtype]
  kernel :
    func : full_like
    param : [x, value, dtype]
    data_type : dtype > x
    backend : place > x
  data_transform :
    skip_transform : x

492 493 494 495 496 497 498 499 500 501 502
- op : fused_adam_
  args : (Tensor[] params, Tensor[] grads, Tensor learning_rate, Tensor[] moments1, Tensor[] moments2, Tensor[] beta1_pows, Tensor[] beta2_pows, Tensor[] master_params, Tensor skip_update, Scalar beta1, Scalar beta2, Scalar epsilon, int chunk_size, float weight_decay, bool use_adamw, bool multi_precision, bool use_global_beta_pow)
  output : Tensor[](params_out){params.size()}, Tensor[](moments1_out){params.size()}, Tensor[](moments2_out){params.size()}, Tensor[](beta1_pows_out){params.size()}, Tensor[](beta2_pows_out){params.size()}, Tensor[](master_params_out){params.size()}
  infer_meta :
    func : FusedAdamInferMeta
  kernel :
    func : fused_adam
    data_type : params
  optional : skip_update, master_params
  inplace : (params -> params_out), (moments1 -> moments1_out), (moments2 -> moments2_out), (beta1_pows -> beta1_pows_out), (beta2_pows -> beta2_pows_out), (master_params -> master_params_out)

503
- op : gather
Z
zyfncg 已提交
504 505 506 507 508 509 510 511 512
  args : (Tensor x, Tensor index, Scalar(int) axis=0)
  output : Tensor(out)
  infer_meta :
    func : GatherInferMeta
  kernel :
    func : gather
    data_type: x
  backward : gather_grad

513
- op : gaussian
Z
zyfncg 已提交
514
  args : (IntArray shape, float mean, float std, int seed, DataType dtype, Place place={})
515
  output: Tensor(out)
Z
zyfncg 已提交
516
  infer_meta :
517
    func : GaussianInferMeta
Z
zyfncg 已提交
518 519
    param : [shape, mean, std, seed, dtype]
  kernel :
520
    func : gaussian
Z
zyfncg 已提交
521 522 523 524
    param : [shape, mean, std, seed, dtype]
    data_type : dtype
    backend : place

525
- op : greater_equal
526
  args : (Tensor x, Tensor y)
527
  output : Tensor(out)
Z
zyfncg 已提交
528 529 530 531 532
  infer_meta :
    func : CompareInferMeta
  kernel :
    func : greater_equal

533
- op : greater_than
534
  args : (Tensor x, Tensor y)
535
  output : Tensor(out)
Z
zyfncg 已提交
536 537 538 539 540
  infer_meta :
    func : CompareInferMeta
  kernel :
    func : greater_than

541
- op : hardswish
542
  args : (Tensor x)
C
cyber-pioneer 已提交
543
  output : Tensor(out)
Z
zyfncg 已提交
544 545 546 547
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
Z
zyfncg 已提交
548
    func : hardswish
549
  backward : hardswish_grad
Z
zyfncg 已提交
550

551 552 553 554 555 556 557 558 559
- op : heaviside
  args : (Tensor x, Tensor y)
  output : Tensor
  infer_meta :
    func : ElementwiseInferMeta
  kernel :
    func : heaviside
  backward : heaviside_grad

560
- op : hsigmoid_loss
Z
zhangyuqin1998 已提交
561
  args : (Tensor x, Tensor label, Tensor w, Tensor bias, Tensor path, Tensor code, int num_classes, bool is_sparse)
562 563 564 565 566 567 568 569 570
  output : Tensor(out), Tensor(pre_out), Tensor(w_out)
  infer_meta :
    func : HSigmoidLossInferMeta
  optional: path, code, bias
  kernel :
    func : hsigmoid_loss
    data_type : x
  backward : hsigmoid_loss_grad

571
- op : increment
572
  args : (Tensor x, float value = 1.0)
573
  output : Tensor(out)
Z
zyfncg 已提交
574 575 576 577
  infer_meta :
    func : IncrementInferMeta
  kernel :
    func : increment
H
hong 已提交
578
  inplace : (x -> out)
Z
zyfncg 已提交
579

580
- op : less_equal
581
  args : (Tensor x, Tensor y)
582
  output : Tensor(out)
Z
zyfncg 已提交
583 584 585 586 587
  infer_meta :
    func : CompareInferMeta
  kernel :
    func : less_equal

588
- op : less_than
589
  args : (Tensor x, Tensor y)
590
  output : Tensor(out)
Z
zyfncg 已提交
591 592 593 594 595
  infer_meta :
    func : CompareInferMeta
  kernel :
    func : less_than

596
- op : linspace
597
  args : (Tensor start, Tensor stop, Tensor number, DataType dtype, Place place)
598
  output : Tensor(out)
Z
zyfncg 已提交
599 600
  infer_meta :
    func : LinspaceInferMeta
601
    param: [start, stop, number, dtype]
Z
zyfncg 已提交
602 603
  kernel :
    func : linspace
604
    param: [start, stop, number, dtype]
Z
zyfncg 已提交
605
    data_type : dtype
606
    backend : place
Z
zyfncg 已提交
607

C
Chen Weihang 已提交
608 609 610 611 612 613 614 615 616 617 618 619
- op : logspace
  args : (Tensor start, Tensor stop, Tensor num, Tensor base, DataType dtype, Place place={})
  output : Tensor(out)
  infer_meta:
    func : LogspaceInferMeta
    param : [start, stop, num, base, dtype]
  kernel :
    func : logspace
    param : [start, stop, num, base, dtype]
    data_type : dtype
    backend : place

620
- op : logsumexp
Z
zyfncg 已提交
621 622 623 624 625 626 627 628
  args : (Tensor x, int64_t[] axis,  bool keepdim,  bool reduce_all)
  output : Tensor(out)
  infer_meta :
    func : LogsumexpInferMeta
  kernel :
    func : logsumexp
  backward : logsumexp_grad

629
- op : matmul
Z
zyfncg 已提交
630 631 632 633 634 635 636 637
  args : (Tensor x, Tensor y, bool transpose_x = false, bool transpose_y = false)
  output : Tensor
  infer_meta :
    func : MatmulInferMeta
  kernel :
    func : matmul
  backward : matmul_grad

638
- op : matrix_rank
Z
zhangyuqin1998 已提交
639
  args : (Tensor x, float tol, bool use_default_tol=true, bool hermitian=false)
Z
zyfncg 已提交
640 641 642
  output : Tensor(out)
  infer_meta :
    func : MatrixRankInferMeta
Z
zhangyuqin1998 已提交
643
    param : [x, use_default_tol, hermitian]
Z
zyfncg 已提交
644 645 646
  kernel :
    func : matrix_rank

647
- op : matrix_rank_tol
Z
zyfncg 已提交
648 649 650 651 652 653 654
  args : (Tensor x, Tensor atol_tensor, bool use_default_tol=true, bool hermitian=false)
  output : Tensor(out)
  infer_meta :
    func : MatrixRankTolInferMeta
  kernel :
    func : matrix_rank_tol

655
- op : max
656
  args : (Tensor x, IntArray axis={}, bool keepdim=false)
Z
zyfncg 已提交
657 658
  output : Tensor(out)
  infer_meta :
659
    func : ReduceIntArrayAxisInferMeta
Z
zyfncg 已提交
660 661 662 663
  kernel :
    func : max
  backward : max_grad

664
- op : maximum
Z
zyfncg 已提交
665 666 667 668 669 670 671 672
  args : (Tensor x, Tensor y)
  output : Tensor(out)
  infer_meta :
    func : ElementwiseInferMeta
  kernel :
    func : maximum
  backward : maximum_grad

673
- op : mean
674
  args : (Tensor x, IntArray axis={}, bool keepdim=false)
Z
zyfncg 已提交
675 676
  output : Tensor(out)
  infer_meta :
677
    func : OriginReduceInferMeta
Z
zyfncg 已提交
678 679 680 681
  kernel :
    func : mean
  backward : mean_grad

682
- op : min
683
  args : (Tensor x, IntArray axis={}, bool keepdim=false)
Z
zyfncg 已提交
684 685
  output : Tensor(out)
  infer_meta :
686
    func : ReduceIntArrayAxisInferMeta
Z
zyfncg 已提交
687 688 689 690
  kernel :
    func : min
  backward : min_grad

691
- op : minimum
Z
zyfncg 已提交
692 693 694 695 696 697 698 699
  args : (Tensor x, Tensor y)
  output : Tensor(out)
  infer_meta :
    func : ElementwiseInferMeta
  kernel :
    func : minimum
  backward : minimum_grad

700
- op : mish
Z
zyfncg 已提交
701 702 703 704 705 706 707 708 709
  args : (Tensor x, float lambda)
  output : Tensor
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : mish
  backward : mish_grad

710
- op : multiclass_nms3
711 712 713 714 715 716 717 718
  args : (Tensor bboxes, Tensor scores, Tensor rois_num, float score_threshold, int nms_top_k, int keep_top_k, float nms_threshold=0.3, bool normalized=true, float nms_eta=1.0, int background_label=0)
  output : Tensor(out), Tensor(index), Tensor(nms_rois_num)
  infer_meta :
    func : MultiClassNMSInferMeta
  kernel :
    func : multiclass_nms3
  optional : rois_num

719
- op : multiply
Z
zyfncg 已提交
720 721 722 723 724
  args : (Tensor x, Tensor y)
  output : Tensor
  infer_meta :
    func : ElementwiseInferMeta
  kernel :
725 726
    func : multiply {dense, dense -> dense},
           multiply_sr {selected_rows, dense -> selected_rows}
727
  inplace : (x -> out)
Z
zyfncg 已提交
728 729
  backward : multiply_grad

730
- op : norm
Z
zyfncg 已提交
731 732 733 734 735 736 737 738
  args : (Tensor x, int axis, float epsilon, bool is_test)
  output : Tensor(out), Tensor(norm)
  infer_meta :
    func : NormInferMeta
  kernel :
    func : norm
  backward : norm_grad

739
- op : not_equal
740
  args : (Tensor x, Tensor y)
741
  output : Tensor(out)
Z
zyfncg 已提交
742 743 744 745 746
  infer_meta :
    func : CompareInferMeta
  kernel :
    func : not_equal

747
- op : one_hot
Z
zyfncg 已提交
748
  args : (Tensor x, Scalar(int) num_classes)
749
  output : Tensor(out)
Z
zyfncg 已提交
750 751 752 753 754
  infer_meta :
    func : OneHotInferMeta
  kernel :
    func : one_hot

755
- op : ones
756
  args : (IntArray shape, DataType dtype=DataType::FLOAT32, Place place=CPUPlace())
757
  output : Tensor(out)
758 759
  invoke : full(shape, 1, dtype, place)

760
- op : ones_like
Z
zyfncg 已提交
761
  args : (Tensor x, DataType dtype=DataType::UNDEFINED, Place place={})
762
  output : Tensor(out)
Z
zyfncg 已提交
763 764
  invoke : full_like(x, 1, dtype, place)

765
- op : pad
766
  args : (Tensor x, int[] paddings, Scalar pad_value)
Z
zyfncg 已提交
767 768 769 770 771 772 773
  output : Tensor
  infer_meta :
    func : PadInferMeta
  kernel :
    func : pad
  backward : pad_grad

774
- op : pad3d
Z
zyfncg 已提交
775 776 777 778 779 780 781 782
  args : (Tensor x, IntArray paddings, str mode,  float pad_value, str data_format)
  output : Tensor(out)
  infer_meta :
    func : Pad3dInferMeta
  kernel :
    func : pad3d
  backward : pad3d_grad

783
- op : pool2d
784
  args : (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)
Z
zyfncg 已提交
785 786
  output : Tensor(out)
  infer_meta :
787
    func : Pool2DInferMeta
788
    param : [x, kernel_size, strides, paddings, ceil_mode, exclusive, data_format, pooling_type, global_pooling, adaptive, padding_algorithm]
Z
zyfncg 已提交
789 790
  kernel :
    func : pool2d
791
    param : [x, kernel_size, strides, paddings, ceil_mode, exclusive, data_format, pooling_type, global_pooling, adaptive, padding_algorithm]
Z
zyfncg 已提交
792 793
  backward : pool2d_grad

794
- op : pool3d
795
  args : (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)
Z
zyfncg 已提交
796 797 798
  output : Tensor(out)
  infer_meta :
    func : PoolInferMeta
799
    param : [x, kernel_size, strides, paddings, ceil_mode, exclusive, data_format, pooling_type, global_pooling, adaptive, padding_algorithm]
Z
zyfncg 已提交
800 801
  kernel :
    func : pool3d
802
    param : [x, kernel_size, strides, paddings, ceil_mode, exclusive, data_format, pooling_type, global_pooling, adaptive, padding_algorithm]
Z
zyfncg 已提交
803 804
  backward : pool3d_grad

805
- op : prior_box
Z
zhangyuqin1998 已提交
806
  args : (Tensor input, Tensor image, float[] min_sizes, float[] max_sizes = {}, float[] aspect_ratios = {}, float[] variances = {}, bool flip=true, bool clip=true, float step_w=0.0, float step_h=0.0, float offset=0.5, bool min_max_aspect_ratios_order=false)
Z
zhiboniu 已提交
807 808 809 810 811 812
  output : Tensor(out), Tensor(var)
  infer_meta :
    func : PriorBoxInferMeta
  kernel :
    func : prior_box

813 814 815 816 817 818
- op : prod
  args : (Tensor x, IntArray dims, bool keep_dim, bool reduce_all)
  output : Tensor
  infer_meta :
    func : ReduceIntArrayAxisInferMetaBase
  kernel :
819
    func : prod
820 821
  backward : prod_grad

822
- op : psroi_pool
Z
zyfncg 已提交
823 824 825 826 827 828 829 830 831 832
  args : (Tensor x, Tensor boxes, Tensor boxes_num, int pooled_height, int pooled_width, int output_channels, float spatial_scale)
  output : Tensor
  infer_meta :
    func : PsroiPoolInferMeta
  kernel :
    func : psroi_pool
    data_type : x
  optional : boxes_num
  backward : psroi_pool_grad

833
- op : randint
Z
zyfncg 已提交
834 835 836 837 838 839 840 841 842 843 844
  args : (int low, int high, IntArray shape, DataType dtype=DataType::INT64, Place place={})
  output : Tensor(out)
  infer_meta :
    func : RandintInferMeta
    param : [low, high, shape, dtype]
  kernel :
    func : randint
    param : [low, high, shape, dtype]
    data_type : dtype
    backend : place

845
- op : randperm
Z
zyfncg 已提交
846
  args : (int n, DataType dtype, Place place={})
847
  output : Tensor(out)
Z
zyfncg 已提交
848 849 850 851 852 853 854 855 856
  infer_meta :
    func : RandpermInferMeta
    param : [n, dtype]
  kernel :
    func : randperm
    param : [n, dtype]
    data_type : dtype
    backend : place

857
- op : relu6
858
  args : (Tensor x)
859 860 861 862 863 864 865 866
  output : Tensor
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : relu6
  backward : relu6_grad

867
- op : remainder
C
Chen Weihang 已提交
868
  args : (Tensor x, Tensor y)
869
  output : Tensor (out)
C
Chen Weihang 已提交
870 871 872 873 874 875
  infer_meta :
    func : ElementwiseInferMeta
  kernel :
    func : remainder
  inplace : (x -> out)

876
- op : repeat_interleave
877
  args : (Tensor x, int repeats, int axis)
S
seemingwang 已提交
878 879 880 881 882 883 884
  output : Tensor(out)
  infer_meta :
    func : RepeatInterleaveInferMeta
  kernel :
    func : repeat_interleave
  backward: repeat_interleave_grad

885
- op : repeat_interleave_with_tensor_index
886
  args : (Tensor x, Tensor repeats, int axis)
S
seemingwang 已提交
887 888 889 890 891 892 893 894
  output : Tensor(out)
  infer_meta :
    func : RepeatInterleaveWithTensorIndexInferMeta
  kernel :
    func : repeat_interleave_with_tensor_index
    data_type : x
  backward: repeat_interleave_with_tensor_index_grad

895
- op : reshape
Z
zyfncg 已提交
896 897 898 899 900
  args : (Tensor x, IntArray shape)
  output : Tensor(out), Tensor(xshape)
  infer_meta :
    func : ReshapeWithXShapeInferMeta
  kernel :
901
    func : reshape
Z
zyfncg 已提交
902 903 904 905 906
  inplace : (x -> out)
  view: (x -> out)
  intermediate : xshape
  backward: reshape_grad

907 908 909 910 911 912 913 914 915 916 917 918 919 920 921
- op : rnn
  args: (Tensor x, Tensor[] pre_state, Tensor[] weight_list, Tensor sequence_length, Tensor dropout_state_in, float dropout_prob=0.0, bool is_bidirec=false, int input_size=10, int hidden_size=100, int num_layers=1, str mode="RNN_TANH", int seed=0, bool is_test=false)
  output: Tensor(out), Tensor(dropout_state_out), Tensor[](state){pre_state.size()}, Tensor(reserve)
  infer_meta:
    func: RnnInferMeta
    param : [x, pre_state, weight_list, sequence_length, dropout_prob, is_bidirec, input_size, hidden_size, num_layers, mode, seed, is_test]
  kernel:
    func: rnn
    param : [x, pre_state, weight_list, sequence_length, dropout_prob, is_bidirec, input_size, hidden_size, num_layers, mode, seed, is_test]
    data_type: x
  backward: rnn_grad
  optional : sequence_length
  intermediate : reserve
  view : (dropout_state_in -> dropout_state_out)

922
- op : roi_align
Z
zyfncg 已提交
923 924 925 926 927 928 929 930 931 932
  args : (Tensor x, Tensor boxes, Tensor boxes_num, int pooled_height, int pooled_width, float spatial_scale, int sampling_ratio, bool aligned)
  output : Tensor
  infer_meta :
    func : RoiAlignInferMeta
  kernel :
    func : roi_align
    data_type : x
  optional : boxes_num
  backward : roi_align_grad

933
- op : roi_pool
Z
zyfncg 已提交
934 935 936 937 938 939 940 941 942 943 944
  args : (Tensor x, Tensor boxes, Tensor boxes_num, int pooled_height, int pooled_width, float spatial_scale)
  output : Tensor(out), Tensor(arg_max)
  infer_meta :
    func : RoiPoolInferMeta
  kernel :
    func : roi_pool
    data_type : x
  optional : boxes_num
  intermediate : arg_max
  backward : roi_pool_grad

W
Weilong Wu 已提交
945 946 947 948 949 950 951 952 953 954 955
- op : rrelu
  args : (Tensor x, float lower, float upper, bool is_test)
  output : Tensor(out), Tensor(noise)
  infer_meta :
    func : RReluInferMeta
  kernel :
    func : rrelu
    data_type : x
  intermediate : noise
  backward : rrelu_grad

956
- op : shape
Z
zyfncg 已提交
957
  args : (Tensor input)
958
  output : Tensor(out)
Z
zyfncg 已提交
959 960 961
  infer_meta :
    func : ShapeInferMeta
  kernel :
962 963
    func : shape {dense -> dense},
           shape_sr {selected_rows -> selected_rows}
Z
zyfncg 已提交
964 965 966
  data_transform:
    skip_transform : input

967
- op : slice
Z
zyfncg 已提交
968 969 970 971 972 973 974 975
  args : (Tensor input, int64_t[] axes, IntArray starts, IntArray ends, int64_t[] infer_flags, int64_t[] decrease_axis)
  output : Tensor
  infer_meta :
    func : SliceRawInferMeta
  kernel :
    func : slice
  backward : slice_grad

976
- op : softmax
Z
zyfncg 已提交
977
  args : (Tensor x, int axis)
978
  output : Tensor(out)
Z
zyfncg 已提交
979 980 981 982
  infer_meta :
    func : SoftmaxInferMeta
  kernel :
    func : softmax
983
  inplace : (x -> out)
Z
zyfncg 已提交
984 985
  backward : softmax_grad

986
- op : split
C
Charles-hit 已提交
987 988 989 990 991 992
  args : (Tensor x, IntArray sections, Scalar(int) axis)
  output : Tensor[]{sections.size()}
  infer_meta :
    func : SplitInferMeta
  kernel :
    func : split
Z
zyfncg 已提交
993 994
  backward : split_grad

995
- op : split_with_num
C
Charles-hit 已提交
996 997 998 999 1000 1001 1002 1003
  args : (Tensor x, int num, Scalar(int) axis)
  output : Tensor[]{num}
  infer_meta :
    func : SplitWithNumInferMeta
  kernel :
    func : split_with_num
  backward : split_with_num_grad

1004
- op : strided_slice
Z
zyfncg 已提交
1005 1006 1007 1008 1009 1010 1011 1012
  args : (Tensor x, int[] axes, IntArray starts, IntArray ends, IntArray strides)
  output : Tensor
  infer_meta :
    func : StridedSliceInferMeta
  kernel :
    func : strided_slice
  backward : strided_slice_grad

1013
- op : subtract
Z
zyfncg 已提交
1014
  args : (Tensor x, Tensor y)
1015
  output : Tensor(out)
Z
zyfncg 已提交
1016 1017 1018 1019
  infer_meta :
    func : ElementwiseInferMeta
  kernel :
    func : subtract
1020
  inplace : (x -> out)
Z
zyfncg 已提交
1021 1022
  backward : subtract_grad

1023
- op : sum
1024
  args : (Tensor x, IntArray axis={}, DataType dtype=DataType::UNDEFINED, bool keepdim=false)
Z
zyfncg 已提交
1025 1026 1027 1028 1029 1030 1031 1032
  output : Tensor(out)
  infer_meta :
    func : SumInferMeta
  kernel :
    func : sum
    data_type : x
  backward : sum_grad

1033
- op : swish
1034
  args : (Tensor x)
Z
zyfncg 已提交
1035 1036 1037 1038 1039 1040 1041 1042
  output : Tensor(out)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : swish
  backward : swish_grad

1043
- op : sync_batch_norm_
1044
  args : (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)
1045 1046 1047 1048 1049
  output : Tensor(out), Tensor(mean_out), Tensor(variance_out), Tensor(saved_mean), Tensor(saved_variance), Tensor(reserve_space)
  infer_meta :
    func : BatchNormInferMeta
  kernel :
    func : sync_batch_norm
1050
    data_type : x
1051
  backward : sync_batch_norm_grad
1052
  inplace : (mean -> mean_out), (variance -> variance_out)
1053

1054
- op : tile
1055 1056
  args : (Tensor x, IntArray repeat_times = {})
  output : Tensor(out)
Z
zyfncg 已提交
1057 1058 1059 1060 1061 1062
  infer_meta :
    func : TileInferMeta
  kernel :
    func : tile
  backward : tile_grad

N
niuliling123 已提交
1063 1064 1065 1066 1067 1068 1069 1070 1071
- op : trans_layout
  args : (Tensor x, int[] perm)
  output : Tensor
  infer_meta :
    func : TransposeInferMeta
  kernel :
    func : transpose
  backward : trans_layout_grad

1072
- op : transpose
1073
  args : (Tensor x, int[] perm)
Z
zyfncg 已提交
1074 1075 1076 1077 1078 1079 1080
  output : Tensor
  infer_meta :
    func : TransposeInferMeta
  kernel :
    func : transpose
  backward : transpose_grad

1081
- op : tril
Z
zyfncg 已提交
1082
  args : (Tensor x, int diagonal)
1083 1084 1085 1086 1087 1088 1089
  output : Tensor(out)
  infer_meta :
    func : TrilInferMeta
  kernel :
    func : tril
  backward : tril_grad

1090
- op : tril_indices
Z
zyfncg 已提交
1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101
  args : (int rows, int cols, int offset, DataType dtype, Place place={})
  output : Tensor(out)
  infer_meta :
    func : TrilIndicesInferMeta
    param : [rows, cols, offset, dtype]
  kernel :
    func : tril_indices
    param : [rows, cols, offset, dtype]
    data_type : dtype
    backend : place

1102
- op : triu
Z
zyfncg 已提交
1103
  args : (Tensor x, int diagonal)
1104 1105 1106 1107 1108 1109 1110
  output : Tensor(out)
  infer_meta :
    func : TriuInferMeta
  kernel :
    func : triu
  backward : triu_grad

1111
- op : triu_indices
1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122
  args : (int row, int col, int offset, DataType dtype, Place place={})
  output : Tensor(out)
  infer_meta :
    func : TriuIndicesInferMeta
    param : [row, col, offset, dtype]
  kernel :
    func : triu_indices
    param : [row, col, offset, dtype]
    data_type : dtype
    backend : place

Z
zyfncg 已提交
1123
# python API: paddle.nn.initializer.TruncatedNormal
1124
- op : truncated_gaussian_random
Z
zyfncg 已提交
1125
  args : (int[] shape, float mean, float std, int seed, DataType dtype=DataType::FLOAT32, Place place={})
1126
  output : Tensor(out)
Z
zyfncg 已提交
1127 1128 1129 1130 1131 1132 1133 1134 1135
  infer_meta :
    func : TruncatedGaussianRandomInferMeta
    param : [shape, mean, std, seed, dtype]
  kernel :
    func : truncated_gaussian_random
    param : [shape, mean, std, seed, dtype]
    backend : place
    data_type : dtype

1136
- op : uniform
1137
  args : (IntArray shape,  DataType dtype,  Scalar min,  Scalar max,  int seed, Place place={})
Z
zyfncg 已提交
1138 1139 1140
  output : Tensor(out)
  infer_meta :
    func : UniformRandomInferMeta
1141
    param: [shape, dtype]
Z
zyfncg 已提交
1142
  kernel :
1143
    func : uniform
Z
zyfncg 已提交
1144 1145 1146 1147 1148
    param: [shape, dtype, min, max, seed]
    data_type : dtype
    backend : place

# The `axis` argument of Python API paddle.unique is not vector
1149
- op : unique
Z
zyfncg 已提交
1150 1151 1152 1153 1154 1155 1156 1157
  args : (Tensor x, bool return_index, bool return_inverse, bool return_counts, int[] axis, DataType dtype=DataType::INT64)
  output : Tensor(out), Tensor(indices), Tensor(inverse), Tensor(counts)
  infer_meta :
    func : UniqueInferMeta
  kernel :
    func : unique
    data_type : x

1158 1159 1160 1161 1162 1163 1164 1165 1166 1167
- op : unpool
  args: (Tensor x, Tensor indices, int[] ksize, int[] strides, int[] padding, IntArray output_size, str data_format)
  output: Tensor(out)
  infer_meta:
    func: UnpoolInferMeta
  kernel:
    func: unpool
    data_type: x
  backward: unpool_grad

1168
- op : zeros
1169
  args : (IntArray shape, DataType dtype=DataType::FLOAT32, Place place=CPUPlace())
1170
  output : Tensor(out)
1171 1172
  invoke : full(shape, 0, dtype, place)

1173
- op : zeros_like
Z
zyfncg 已提交
1174
  args : (Tensor x, DataType dtype=DataType::UNDEFINED, Place place = {})
1175
  output : Tensor(out)
Z
zyfncg 已提交
1176
  invoke : full_like(x, 0, dtype, place)