legacy_ops.yaml 27.1 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
    data_type : param
H
hong 已提交
12
  optional : master_param, master_param_out
13
  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
  args : (Tensor x)
  output : Tensor
  infer_meta :
    func : UnchangedInferMeta
  kernel :
    func : assign
  backward : assign_grad
87
  inplace : (x -> out)
Z
zyfncg 已提交
88

89
- op : assign_out_
Z
zyfncg 已提交
90 91 92 93 94 95 96 97 98 99 100
  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

101
- op : assign_value_
102 103 104 105 106 107 108 109 110 111
  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
112
    backend : place > output
113

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

H
hong 已提交
126 127 128 129 130 131 132 133 134
- op : c_concat
  args : (Tensor x, int rank, int nranks, int ring_id, bool use_calc_stream, bool use_model_parallel)
  output : Tensor(out)
  infer_meta :
    func : CConcatInferMeta
    param : [x, nranks]
  kernel :
    func : c_concat

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

146 147 148 149 150 151 152 153 154
- 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

155
- op : conv2d_transpose
156
  args : (Tensor x, Tensor filter, int[] strides={1, 1}, int[] paddings={0, 0}, int[] output_padding={}, IntArray output_size={}, str padding_algorithm="EXPLICIT", int groups=1, int[] dilations={1, 1}, str data_format="NCHW")
Z
zyfncg 已提交
157 158
  output : Tensor(out)
  infer_meta :
159
    func : Conv2dTransposeInferMeta
Z
zyfncg 已提交
160 161
  kernel :
    func : conv2d_transpose
162
    data_type : x
Z
zyfncg 已提交
163 164
  backward : conv2d_transpose_grad

165
- op : copy_to
Z
zyfncg 已提交
166
  args : (Tensor x, Place place, bool blocking)
167
  output : Tensor(out)
Z
zyfncg 已提交
168 169
  invoke : copy_to_impl(x, place, blocking)

170
- op : decode_jpeg
Y
YuanRisheng 已提交
171
  args : (Tensor x, str mode, Place place)
W
wuyefeilin 已提交
172 173 174
  output : Tensor(out)
  infer_meta :
    func : DecodeJpegInferMeta
Y
YuanRisheng 已提交
175
    param : [x, mode]
W
wuyefeilin 已提交
176 177
  kernel :
    func : decode_jpeg
Y
YuanRisheng 已提交
178 179
    param : [x, mode]
    backend : place
W
wuyefeilin 已提交
180

181
- op : deformable_conv
Z
zyfncg 已提交
182 183 184 185 186 187 188 189 190 191
  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

192
- op : depthwise_conv2d_transpose
193
  args : (Tensor x, Tensor filter, int[] strides={1, 1}, int[] paddings={0, 0}, int[] output_padding={}, IntArray output_size={}, str padding_algorithm="EXPLICIT", int groups=1, int[] dilations={1, 1}, str data_format="NCHW")
Z
zyfncg 已提交
194 195
  output : Tensor(out)
  infer_meta :
196
    func : Conv2dTransposeInferMeta
Z
zyfncg 已提交
197 198
  kernel :
    func : depthwise_conv2d_transpose
199
    data_type : x
Z
zyfncg 已提交
200 201
  backward : depthwise_conv2d_transpose_grad

202
- op : distribute_fpn_proposals
203 204 205 206 207 208 209 210 211
  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

212
- op : divide
Z
zyfncg 已提交
213 214 215 216 217 218 219 220
  args : (Tensor x, Tensor y)
  output : Tensor
  infer_meta :
    func : ElementwiseInferMeta
  kernel :
    func : divide
  backward : divide_grad

221
- op : dropout
222
  args : (Tensor x, Tensor seed_tensor, Scalar p, bool is_test, str mode, int seed, bool fix_seed)
Z
zyfncg 已提交
223 224 225 226 227 228 229 230 231
  output : Tensor(out), Tensor(mask)
  infer_meta :
    func : DropoutInferMeta
  kernel :
    func : dropout
    data_type : x
  optional : seed_tensor
  backward : dropout_grad

232
- op : einsum
Z
zyfncg 已提交
233
  args : (Tensor[] x, str equation)
234
  output : Tensor(out), Tensor[](inner_cache){x.size()}, Tensor[](xshape){x.size()}
Z
zyfncg 已提交
235
  infer_meta :
236
    func : EinsumRawInferMeta
Z
zyfncg 已提交
237 238
    param : [x, equation]
  kernel :
239
    func : einsum
Z
zyfncg 已提交
240 241
  backward : einsum_grad

242
- op : elementwise_pow
Z
zyfncg 已提交
243 244 245 246 247 248 249 250
  args : (Tensor x, Tensor y)
  output : Tensor(out)
  infer_meta :
    func : ElementwiseInferMeta
  kernel :
    func : elementwise_pow
  backward : elementwise_pow_grad

251
- op : embedding
Z
zyfncg 已提交
252 253
  args : (Tensor x, Tensor weight, int64_t padding_idx=-1, bool sparse=false)
  output : Tensor
254 255 256 257 258 259 260 261
  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 已提交
262 263
  backward : embedding_grad

H
hong 已提交
264 265 266 267 268 269 270 271 272 273
- op : embedding_grad_dense
  args : (Tensor x, Tensor weight, Tensor out_grad, int64_t padding_idx=-1, bool sparse=false)
  output : Tensor(weight_grad)
  infer_meta :
    func : UnchangedInferMeta
    param : [weight]
  kernel :
    func : embedding_grad
    data_type : weight

274
- op : empty
Z
zyfncg 已提交
275
  args : (IntArray shape, DataType dtype=DataType::FLOAT32, Place place=CPUPlace())
276
  output: Tensor(out)
Z
zyfncg 已提交
277 278 279 280 281 282 283 284 285
  infer_meta :
    func : CreateInferMeta
    param : [shape, dtype]
  kernel :
    func : empty
    param : [shape, dtype]
    data_type : dtype
    backend : place

286
- op : empty_like
Z
zyfncg 已提交
287
  args : (Tensor x, DataType dtype = DataType::UNDEFINED, Place place = {})
288
  output: Tensor(out)
Z
zyfncg 已提交
289 290 291 292 293 294 295 296 297
  infer_meta :
    func : CreateLikeInferMeta
    param : [x, dtype]
  kernel :
    func : empty_like
    param : [x, dtype]
    data_type : dtype > x
    backend : place > x

298
- op : equal
299
  args : (Tensor x, Tensor y)
300
  output : Tensor(out)
Z
zyfncg 已提交
301 302 303 304 305
  infer_meta :
    func : CompareInferMeta
  kernel :
    func : equal

306
- op : exponential_
307
  args : (Tensor x, float lam)
308 309 310 311 312 313 314 315 316
  output : Tensor(out)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : exponential
  inplace : (x -> out)
  backward : exponential__grad

317
- op : eye
318
  args : (Scalar num_rows, Scalar num_columns, DataType dtype=DataType::FLOAT32, Place place={})
Z
zyfncg 已提交
319 320 321 322 323 324 325 326 327 328
  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

329
- op : floor_divide
Z
zyfncg 已提交
330 331 332 333 334 335 336
  args : (Tensor x, Tensor y)
  output : Tensor(out)
  infer_meta :
    func : ElementwiseInferMeta
  kernel :
    func : floor_divide

337
- op : frobenius_norm
Z
zyfncg 已提交
338 339 340 341 342 343 344 345
  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

346
- op : full
Z
zyfncg 已提交
347
  args : (IntArray shape, Scalar value, DataType dtype=DataType::FLOAT32, Place place=CPUPlace())
348
  output: Tensor(out)
Z
zyfncg 已提交
349 350 351 352 353 354 355 356 357
  infer_meta :
    func : CreateInferMeta
    param : [shape, dtype]
  kernel :
    func : full
    param : [shape, value, dtype]
    data_type : dtype
    backend : place

358
- op : full_
359 360 361 362 363 364 365 366 367 368 369 370
  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

371
- op : full_batch_size_like
Z
zyfncg 已提交
372
  args : (Tensor input, int[] shape, DataType dtype, Scalar value, int input_dim_idx, int output_dim_idx, Place place=CPUPlace())
373
  output: Tensor(out)
Z
zyfncg 已提交
374 375 376 377 378 379 380 381 382
  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

383
- op : full_like
Z
zyfncg 已提交
384
  args : (Tensor x, Scalar value, DataType dtype = DataType::UNDEFINED, Place place = {})
385
  output: Tensor(out)
Z
zyfncg 已提交
386 387 388 389 390 391 392 393 394 395 396
  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

397 398 399 400 401 402 403 404 405 406 407
- 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)

H
hong 已提交
408 409 410 411 412 413 414 415 416
- op : fused_softmax_mask_upper_triangle
  args : (Tensor X)
  output : Tensor(Out)
  infer_meta :
    func : UnchangedInferMeta
  kernel:
    func : fused_softmax_mask_upper_triangle
  backward: fused_softmax_mask_upper_triangle_grad

417
- op : gaussian
Z
zyfncg 已提交
418
  args : (IntArray shape, float mean, float std, int seed, DataType dtype, Place place={})
419
  output: Tensor(out)
Z
zyfncg 已提交
420
  infer_meta :
421
    func : GaussianInferMeta
Z
zyfncg 已提交
422 423
    param : [shape, mean, std, seed, dtype]
  kernel :
424
    func : gaussian
Z
zyfncg 已提交
425 426 427 428
    param : [shape, mean, std, seed, dtype]
    data_type : dtype
    backend : place

429
- op : greater_equal
430
  args : (Tensor x, Tensor y)
431
  output : Tensor(out)
Z
zyfncg 已提交
432 433 434 435 436
  infer_meta :
    func : CompareInferMeta
  kernel :
    func : greater_equal

437
- op : greater_than
438
  args : (Tensor x, Tensor y)
439
  output : Tensor(out)
Z
zyfncg 已提交
440 441 442 443 444
  infer_meta :
    func : CompareInferMeta
  kernel :
    func : greater_than

445
- op : hardswish
446
  args : (Tensor x)
C
cyber-pioneer 已提交
447
  output : Tensor(out)
Z
zyfncg 已提交
448 449 450 451
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
Z
zyfncg 已提交
452
    func : hardswish
453
  backward : hardswish_grad
Z
zyfncg 已提交
454

455
- op : hsigmoid_loss
Z
zhangyuqin1998 已提交
456
  args : (Tensor x, Tensor label, Tensor w, Tensor bias, Tensor path, Tensor code, int num_classes, bool is_sparse)
457 458 459 460 461 462 463 464 465
  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

466
- op : increment
467
  args : (Tensor x, float value = 1.0)
468
  output : Tensor(out)
Z
zyfncg 已提交
469 470 471 472
  infer_meta :
    func : IncrementInferMeta
  kernel :
    func : increment
H
hong 已提交
473
  inplace : (x -> out)
Z
zyfncg 已提交
474

475
- op : less_equal
476
  args : (Tensor x, Tensor y)
477
  output : Tensor(out)
Z
zyfncg 已提交
478 479 480 481 482
  infer_meta :
    func : CompareInferMeta
  kernel :
    func : less_equal

483
- op : less_than
484
  args : (Tensor x, Tensor y)
485
  output : Tensor(out)
Z
zyfncg 已提交
486 487 488 489 490
  infer_meta :
    func : CompareInferMeta
  kernel :
    func : less_than

491
- op : linspace
492
  args : (Tensor start, Tensor stop, Tensor number, DataType dtype, Place place)
493
  output : Tensor(out)
Z
zyfncg 已提交
494 495
  infer_meta :
    func : LinspaceInferMeta
496
    param: [start, stop, number, dtype]
Z
zyfncg 已提交
497 498
  kernel :
    func : linspace
499
    param: [start, stop, number, dtype]
Z
zyfncg 已提交
500
    data_type : dtype
501
    backend : place
Z
zyfncg 已提交
502

C
Chen Weihang 已提交
503 504 505 506 507 508 509 510 511 512 513 514
- 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

515
- op : logsumexp
Z
zyfncg 已提交
516 517 518 519 520 521 522 523
  args : (Tensor x, int64_t[] axis,  bool keepdim,  bool reduce_all)
  output : Tensor(out)
  infer_meta :
    func : LogsumexpInferMeta
  kernel :
    func : logsumexp
  backward : logsumexp_grad

524
- op : matmul
Z
zyfncg 已提交
525 526 527 528 529 530 531 532
  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

R
RichardWooSJTU 已提交
533 534 535 536 537 538 539 540
- op : matmul_int8
  args : (Tensor x, Tensor y, bool transpose_x = false, bool transpose_y = false)
  output : Tensor
  infer_meta :
    func : MatmulInt8InferMeta
  kernel :
    func : matmul_int8

541
- op : matrix_rank
Z
zhangyuqin1998 已提交
542
  args : (Tensor x, float tol, bool use_default_tol=true, bool hermitian=false)
Z
zyfncg 已提交
543 544 545
  output : Tensor(out)
  infer_meta :
    func : MatrixRankInferMeta
Z
zhangyuqin1998 已提交
546
    param : [x, use_default_tol, hermitian]
Z
zyfncg 已提交
547 548 549
  kernel :
    func : matrix_rank

550
- op : matrix_rank_tol
Z
zyfncg 已提交
551 552 553 554 555 556 557
  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

558
- op : max
559
  args : (Tensor x, IntArray axis={}, bool keepdim=false)
Z
zyfncg 已提交
560 561
  output : Tensor(out)
  infer_meta :
562
    func : ReduceIntArrayAxisInferMeta
Z
zyfncg 已提交
563 564 565 566
  kernel :
    func : max
  backward : max_grad

567
- op : maximum
Z
zyfncg 已提交
568 569 570 571 572 573 574 575
  args : (Tensor x, Tensor y)
  output : Tensor(out)
  infer_meta :
    func : ElementwiseInferMeta
  kernel :
    func : maximum
  backward : maximum_grad

576
- op : mean
577
  args : (Tensor x, IntArray axis={}, bool keepdim=false)
Z
zyfncg 已提交
578 579
  output : Tensor(out)
  infer_meta :
580
    func : ReduceIntArrayAxisInferMeta
Z
zyfncg 已提交
581 582 583 584
  kernel :
    func : mean
  backward : mean_grad

H
hong 已提交
585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602
- op : memcpy_d2h
  args : (Tensor x, int dst_place_type)
  output : Tensor
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : memcpy_d2h

- op : memcpy_h2d
  args : (Tensor x, int dst_place_type)
  output : Tensor
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : memcpy_h2d

603
- op : min
604
  args : (Tensor x, IntArray axis={}, bool keepdim=false)
Z
zyfncg 已提交
605 606
  output : Tensor(out)
  infer_meta :
607
    func : ReduceIntArrayAxisInferMeta
Z
zyfncg 已提交
608 609 610 611
  kernel :
    func : min
  backward : min_grad

612
- op : minimum
Z
zyfncg 已提交
613 614 615 616 617 618 619 620
  args : (Tensor x, Tensor y)
  output : Tensor(out)
  infer_meta :
    func : ElementwiseInferMeta
  kernel :
    func : minimum
  backward : minimum_grad

621
- op : mish
Z
zyfncg 已提交
622 623 624 625 626 627 628 629 630
  args : (Tensor x, float lambda)
  output : Tensor
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : mish
  backward : mish_grad

631
- op : multiply
Z
zyfncg 已提交
632 633 634 635 636
  args : (Tensor x, Tensor y)
  output : Tensor
  infer_meta :
    func : ElementwiseInferMeta
  kernel :
637 638
    func : multiply {dense, dense -> dense},
           multiply_sr {selected_rows, dense -> selected_rows}
639
  inplace : (x -> out)
Z
zyfncg 已提交
640 641
  backward : multiply_grad

642
- op : norm
Z
zyfncg 已提交
643 644 645 646 647 648 649 650
  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

651
- op : not_equal
652
  args : (Tensor x, Tensor y)
653
  output : Tensor(out)
Z
zyfncg 已提交
654 655 656 657 658
  infer_meta :
    func : CompareInferMeta
  kernel :
    func : not_equal

659
- op : one_hot
Z
zyfncg 已提交
660
  args : (Tensor x, Scalar(int) num_classes)
661
  output : Tensor(out)
Z
zyfncg 已提交
662 663 664 665 666
  infer_meta :
    func : OneHotInferMeta
  kernel :
    func : one_hot

667
- op : ones
668
  args : (IntArray shape, DataType dtype=DataType::FLOAT32, Place place=CPUPlace())
669
  output : Tensor(out)
670 671
  invoke : full(shape, 1, dtype, place)

672
- op : ones_like
Z
zyfncg 已提交
673
  args : (Tensor x, DataType dtype=DataType::UNDEFINED, Place place={})
674
  output : Tensor(out)
Z
zyfncg 已提交
675 676
  invoke : full_like(x, 1, dtype, place)

677
- op : pad
678
  args : (Tensor x, int[] paddings, Scalar pad_value)
Z
zyfncg 已提交
679 680 681 682 683 684 685
  output : Tensor
  infer_meta :
    func : PadInferMeta
  kernel :
    func : pad
  backward : pad_grad

686
- op : pool2d
687
  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 已提交
688 689
  output : Tensor(out)
  infer_meta :
690
    func : Pool2DInferMeta
691
    param : [x, kernel_size, strides, paddings, ceil_mode, exclusive, data_format, pooling_type, global_pooling, adaptive, padding_algorithm]
Z
zyfncg 已提交
692 693
  kernel :
    func : pool2d
694
    param : [x, kernel_size, strides, paddings, ceil_mode, exclusive, data_format, pooling_type, global_pooling, adaptive, padding_algorithm]
Z
zyfncg 已提交
695 696
  backward : pool2d_grad

697
- op : pool3d
698
  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 已提交
699 700 701
  output : Tensor(out)
  infer_meta :
    func : PoolInferMeta
702
    param : [x, kernel_size, strides, paddings, ceil_mode, exclusive, data_format, pooling_type, global_pooling, adaptive, padding_algorithm]
Z
zyfncg 已提交
703 704
  kernel :
    func : pool3d
705
    param : [x, kernel_size, strides, paddings, ceil_mode, exclusive, data_format, pooling_type, global_pooling, adaptive, padding_algorithm]
Z
zyfncg 已提交
706 707
  backward : pool3d_grad

708 709 710 711 712 713
- op : prod
  args : (Tensor x, IntArray dims, bool keep_dim, bool reduce_all)
  output : Tensor
  infer_meta :
    func : ReduceIntArrayAxisInferMetaBase
  kernel :
714
    func : prod
715 716
  backward : prod_grad

717
- op : randint
Z
zyfncg 已提交
718 719 720 721 722 723 724 725 726 727 728
  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

729
- op : randperm
Z
zyfncg 已提交
730
  args : (int n, DataType dtype, Place place={})
731
  output : Tensor(out)
Z
zyfncg 已提交
732 733 734 735 736 737 738 739 740
  infer_meta :
    func : RandpermInferMeta
    param : [n, dtype]
  kernel :
    func : randperm
    param : [n, dtype]
    data_type : dtype
    backend : place

741
- op : remainder
C
Chen Weihang 已提交
742
  args : (Tensor x, Tensor y)
743
  output : Tensor (out)
C
Chen Weihang 已提交
744 745 746 747 748 749
  infer_meta :
    func : ElementwiseInferMeta
  kernel :
    func : remainder
  inplace : (x -> out)

750
- op : repeat_interleave
751
  args : (Tensor x, int repeats, int axis)
S
seemingwang 已提交
752 753 754 755 756 757 758
  output : Tensor(out)
  infer_meta :
    func : RepeatInterleaveInferMeta
  kernel :
    func : repeat_interleave
  backward: repeat_interleave_grad

759
- op : repeat_interleave_with_tensor_index
760
  args : (Tensor x, Tensor repeats, int axis)
S
seemingwang 已提交
761 762 763 764 765 766 767 768
  output : Tensor(out)
  infer_meta :
    func : RepeatInterleaveWithTensorIndexInferMeta
  kernel :
    func : repeat_interleave_with_tensor_index
    data_type : x
  backward: repeat_interleave_with_tensor_index_grad

769
- op : reshape
Z
zyfncg 已提交
770 771 772 773 774
  args : (Tensor x, IntArray shape)
  output : Tensor(out), Tensor(xshape)
  infer_meta :
    func : ReshapeWithXShapeInferMeta
  kernel :
775
    func : reshape
Z
zyfncg 已提交
776 777 778 779 780
  inplace : (x -> out)
  view: (x -> out)
  intermediate : xshape
  backward: reshape_grad

781 782 783 784 785 786 787 788 789 790 791 792 793 794 795
- 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)

W
Weilong Wu 已提交
796 797 798 799 800 801 802 803 804 805 806
- 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

807
- op : slice
Z
zyfncg 已提交
808 809 810 811 812 813 814 815
  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

816
- op : softmax
Z
zyfncg 已提交
817
  args : (Tensor x, int axis)
818
  output : Tensor(out)
Z
zyfncg 已提交
819 820 821 822
  infer_meta :
    func : SoftmaxInferMeta
  kernel :
    func : softmax
823
  inplace : (x -> out)
Z
zyfncg 已提交
824 825
  backward : softmax_grad

826
- op : split
C
Charles-hit 已提交
827 828 829 830 831 832
  args : (Tensor x, IntArray sections, Scalar(int) axis)
  output : Tensor[]{sections.size()}
  infer_meta :
    func : SplitInferMeta
  kernel :
    func : split
Z
zyfncg 已提交
833 834
  backward : split_grad

835
- op : split_with_num
C
Charles-hit 已提交
836 837 838 839 840 841 842 843
  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

844
- op : strided_slice
Z
zyfncg 已提交
845 846 847 848 849 850 851 852
  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

853
- op : subtract
Z
zyfncg 已提交
854
  args : (Tensor x, Tensor y)
855
  output : Tensor(out)
Z
zyfncg 已提交
856 857 858 859
  infer_meta :
    func : ElementwiseInferMeta
  kernel :
    func : subtract
860
  inplace : (x -> out)
Z
zyfncg 已提交
861 862
  backward : subtract_grad

863
- op : sum
864
  args : (Tensor x, IntArray axis={}, DataType dtype=DataType::UNDEFINED, bool keepdim=false)
Z
zyfncg 已提交
865 866 867 868 869 870 871 872
  output : Tensor(out)
  infer_meta :
    func : SumInferMeta
  kernel :
    func : sum
    data_type : x
  backward : sum_grad

873
- op : swish
874
  args : (Tensor x)
Z
zyfncg 已提交
875 876 877 878 879 880 881 882
  output : Tensor(out)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : swish
  backward : swish_grad

883
- op : sync_batch_norm_
884
  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)
885 886 887 888 889
  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
890
    data_type : x
891
  backward : sync_batch_norm_grad
892
  inplace : (mean -> mean_out), (variance -> variance_out)
893

894
- op : tile
895 896
  args : (Tensor x, IntArray repeat_times = {})
  output : Tensor(out)
Z
zyfncg 已提交
897 898 899 900 901 902
  infer_meta :
    func : TileInferMeta
  kernel :
    func : tile
  backward : tile_grad

N
niuliling123 已提交
903 904 905 906 907 908 909 910 911
- op : trans_layout
  args : (Tensor x, int[] perm)
  output : Tensor
  infer_meta :
    func : TransposeInferMeta
  kernel :
    func : transpose
  backward : trans_layout_grad

912
- op : transpose
913
  args : (Tensor x, int[] perm)
914
  output : Tensor(out)
Z
zyfncg 已提交
915 916 917 918 919 920
  infer_meta :
    func : TransposeInferMeta
  kernel :
    func : transpose
  backward : transpose_grad

921
- op : tril
Z
zyfncg 已提交
922
  args : (Tensor x, int diagonal)
923 924 925 926 927
  output : Tensor(out)
  infer_meta :
    func : TrilInferMeta
  kernel :
    func : tril
928
  inplace: (x -> out)
929 930
  backward : tril_grad

931
- op : tril_indices
Z
zyfncg 已提交
932 933 934 935 936 937 938 939 940 941 942
  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

943
- op : triu
Z
zyfncg 已提交
944
  args : (Tensor x, int diagonal)
945 946 947 948 949
  output : Tensor(out)
  infer_meta :
    func : TriuInferMeta
  kernel :
    func : triu
950
  inplace: (x -> out)
951 952
  backward : triu_grad

953
- op : triu_indices
954 955 956 957 958 959 960 961 962 963 964
  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 已提交
965
# python API: paddle.nn.initializer.TruncatedNormal
966
- op : truncated_gaussian_random
Z
zyfncg 已提交
967
  args : (int[] shape, float mean, float std, int seed, DataType dtype=DataType::FLOAT32, Place place={})
968
  output : Tensor(out)
Z
zyfncg 已提交
969 970 971 972 973 974 975 976 977
  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

978
- op : uniform
979
  args : (IntArray shape,  DataType dtype,  Scalar min,  Scalar max,  int seed, Place place={})
Z
zyfncg 已提交
980 981 982
  output : Tensor(out)
  infer_meta :
    func : UniformRandomInferMeta
983
    param: [shape, dtype]
Z
zyfncg 已提交
984
  kernel :
985
    func : uniform
Z
zyfncg 已提交
986 987 988 989 990
    param: [shape, dtype, min, max, seed]
    data_type : dtype
    backend : place

# The `axis` argument of Python API paddle.unique is not vector
991
- op : unique
Z
zyfncg 已提交
992 993 994 995 996 997 998
  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
999
  optional : indices, inverse, counts
Z
zyfncg 已提交
1000

1001 1002 1003 1004 1005 1006 1007 1008 1009 1010
- 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

1011
- op : zeros
1012
  args : (IntArray shape, DataType dtype=DataType::FLOAT32, Place place=CPUPlace())
1013
  output : Tensor(out)
1014 1015
  invoke : full(shape, 0, dtype, place)

1016
- op : zeros_like
Z
zyfncg 已提交
1017
  args : (Tensor x, DataType dtype=DataType::UNDEFINED, Place place = {})
1018
  output : Tensor(out)
Z
zyfncg 已提交
1019
  invoke : full_like(x, 0, dtype, place)