legacy_ops.yaml 28.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

L
Leo Chen 已提交
126 127 128 129 130 131 132 133 134 135
- op : c_broadcast
  args : (Tensor x, int ring_id=0, int root=0, bool use_calc_stream=false)
  output : Tensor(out)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : c_broadcast
  inplace : (x -> out)

H
hong 已提交
136 137 138 139 140 141 142 143 144
- 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

145
- op : cast
146
  args : (Tensor x, DataType dtype)
Z
zyfncg 已提交
147 148 149 150 151
  output : Tensor
  infer_meta :
    func : CastInferMeta
  kernel :
    func : cast
152
    param : [x, dtype]
Z
zyfncg 已提交
153 154 155
    data_type : x
  backward : cast_grad

156 157 158 159 160 161 162 163 164
- 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

165
- op : conv2d_transpose
166
  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 已提交
167 168
  output : Tensor(out)
  infer_meta :
169
    func : Conv2dTransposeInferMeta
Z
zyfncg 已提交
170 171
  kernel :
    func : conv2d_transpose
172
    data_type : x
Z
zyfncg 已提交
173 174
  backward : conv2d_transpose_grad

175
- op : copy_to
Z
zyfncg 已提交
176
  args : (Tensor x, Place place, bool blocking)
177
  output : Tensor(out)
Z
zyfncg 已提交
178 179
  invoke : copy_to_impl(x, place, blocking)

180
- op : decode_jpeg
Y
YuanRisheng 已提交
181
  args : (Tensor x, str mode, Place place)
W
wuyefeilin 已提交
182 183 184
  output : Tensor(out)
  infer_meta :
    func : DecodeJpegInferMeta
Y
YuanRisheng 已提交
185
    param : [x, mode]
W
wuyefeilin 已提交
186 187
  kernel :
    func : decode_jpeg
Y
YuanRisheng 已提交
188 189
    param : [x, mode]
    backend : place
W
wuyefeilin 已提交
190

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

202
- op : depthwise_conv2d_transpose
203
  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 已提交
204 205
  output : Tensor(out)
  infer_meta :
206
    func : Conv2dTransposeInferMeta
Z
zyfncg 已提交
207 208
  kernel :
    func : depthwise_conv2d_transpose
209
    data_type : x
Z
zyfncg 已提交
210 211
  backward : depthwise_conv2d_transpose_grad

212 213 214 215 216 217 218 219 220 221 222
- op : disable_check_model_nan_inf
  args: (Tensor x, int flag = 0)
  output: Tensor(out)
  infer_meta:
    func: UnchangedInferMeta
    param : [x]
  kernel:
    func: check_model_nan_inf
    data_type: x
  backward: disable_check_model_nan_inf_grad

223
- op : distribute_fpn_proposals
224 225 226 227 228 229 230 231 232
  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

233
- op : divide
Z
zyfncg 已提交
234 235 236 237 238 239 240 241
  args : (Tensor x, Tensor y)
  output : Tensor
  infer_meta :
    func : ElementwiseInferMeta
  kernel :
    func : divide
  backward : divide_grad

242
- op : dropout
243
  args : (Tensor x, Tensor seed_tensor, Scalar p, bool is_test, str mode, int seed, bool fix_seed)
Z
zyfncg 已提交
244 245 246 247 248 249 250 251 252
  output : Tensor(out), Tensor(mask)
  infer_meta :
    func : DropoutInferMeta
  kernel :
    func : dropout
    data_type : x
  optional : seed_tensor
  backward : dropout_grad

253
- op : einsum
Z
zyfncg 已提交
254
  args : (Tensor[] x, str equation)
255
  output : Tensor(out), Tensor[](inner_cache){x.size()}, Tensor[](xshape){x.size()}
Z
zyfncg 已提交
256
  infer_meta :
257
    func : EinsumRawInferMeta
Z
zyfncg 已提交
258 259
    param : [x, equation]
  kernel :
260
    func : einsum
Z
zyfncg 已提交
261 262
  backward : einsum_grad

263
- op : elementwise_pow
Z
zyfncg 已提交
264 265 266 267 268 269 270 271
  args : (Tensor x, Tensor y)
  output : Tensor(out)
  infer_meta :
    func : ElementwiseInferMeta
  kernel :
    func : elementwise_pow
  backward : elementwise_pow_grad

272
- op : embedding
Z
zyfncg 已提交
273 274
  args : (Tensor x, Tensor weight, int64_t padding_idx=-1, bool sparse=false)
  output : Tensor
275 276 277 278 279 280 281 282
  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 已提交
283 284
  backward : embedding_grad

H
hong 已提交
285 286 287 288 289 290 291 292 293 294
- 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

295
- op : empty
Z
zyfncg 已提交
296
  args : (IntArray shape, DataType dtype=DataType::FLOAT32, Place place=CPUPlace())
297
  output: Tensor(out)
Z
zyfncg 已提交
298 299 300 301 302 303 304 305 306
  infer_meta :
    func : CreateInferMeta
    param : [shape, dtype]
  kernel :
    func : empty
    param : [shape, dtype]
    data_type : dtype
    backend : place

307
- op : empty_like
Z
zyfncg 已提交
308
  args : (Tensor x, DataType dtype = DataType::UNDEFINED, Place place = {})
309
  output: Tensor(out)
Z
zyfncg 已提交
310 311 312 313 314 315 316 317 318
  infer_meta :
    func : CreateLikeInferMeta
    param : [x, dtype]
  kernel :
    func : empty_like
    param : [x, dtype]
    data_type : dtype > x
    backend : place > x

319 320 321 322 323 324 325 326 327 328 329
- op : enable_check_model_nan_inf
  args: (Tensor x, int flag = 1)
  output: Tensor(out)
  infer_meta:
    func: UnchangedInferMeta
    param : [x]
  kernel:
    func: check_model_nan_inf
    data_type: x
  backward: enable_check_model_nan_inf_grad

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

338
- op : exponential_
339
  args : (Tensor x, float lam)
340 341 342 343 344 345 346 347 348
  output : Tensor(out)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : exponential
  inplace : (x -> out)
  backward : exponential__grad

349
- op : eye
350
  args : (Scalar num_rows, Scalar num_columns, DataType dtype=DataType::FLOAT32, Place place={})
Z
zyfncg 已提交
351 352 353 354 355 356 357 358 359 360
  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

361
- op : floor_divide
Z
zyfncg 已提交
362 363 364 365 366 367 368
  args : (Tensor x, Tensor y)
  output : Tensor(out)
  infer_meta :
    func : ElementwiseInferMeta
  kernel :
    func : floor_divide

369
- op : frobenius_norm
Z
zyfncg 已提交
370 371 372 373 374 375 376 377
  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

378
- op : full
Z
zyfncg 已提交
379
  args : (IntArray shape, Scalar value, DataType dtype=DataType::FLOAT32, Place place=CPUPlace())
380
  output: Tensor(out)
Z
zyfncg 已提交
381 382 383 384 385 386 387 388 389
  infer_meta :
    func : CreateInferMeta
    param : [shape, dtype]
  kernel :
    func : full
    param : [shape, value, dtype]
    data_type : dtype
    backend : place

390
- op : full_
391 392 393 394 395 396 397 398 399 400 401 402
  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

403
- op : full_batch_size_like
Z
zyfncg 已提交
404
  args : (Tensor input, int[] shape, DataType dtype, Scalar value, int input_dim_idx, int output_dim_idx, Place place=CPUPlace())
405
  output: Tensor(out)
Z
zyfncg 已提交
406 407 408 409 410 411 412 413 414
  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

415
- op : full_like
Z
zyfncg 已提交
416
  args : (Tensor x, Scalar value, DataType dtype = DataType::UNDEFINED, Place place = {})
417
  output: Tensor(out)
Z
zyfncg 已提交
418 419 420 421 422 423 424 425 426 427 428
  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

W
wanghuancoder 已提交
429 430 431 432 433 434 435 436 437 438
- op : full_with_tensor
  args : (Tensor shape, Tensor value, DataType dtype=DataType::FLOAT32)
  output: Tensor(out)
  infer_meta :
    func : FullWithTensorInferMeta
    param : [shape, dtype]
  kernel :
    func : full_with_tensor
    data_type : dtype

439 440 441 442 443 444 445 446 447 448 449
- 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 已提交
450 451 452 453 454 455 456 457 458
- 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

459
- op : gaussian
Z
zyfncg 已提交
460
  args : (IntArray shape, float mean, float std, int seed, DataType dtype, Place place={})
461
  output: Tensor(out)
Z
zyfncg 已提交
462
  infer_meta :
463
    func : GaussianInferMeta
Z
zyfncg 已提交
464 465
    param : [shape, mean, std, seed, dtype]
  kernel :
466
    func : gaussian
Z
zyfncg 已提交
467 468 469 470
    param : [shape, mean, std, seed, dtype]
    data_type : dtype
    backend : place

471
- op : greater_equal
472
  args : (Tensor x, Tensor y)
473
  output : Tensor(out)
Z
zyfncg 已提交
474 475 476 477 478
  infer_meta :
    func : CompareInferMeta
  kernel :
    func : greater_equal

479
- op : greater_than
480
  args : (Tensor x, Tensor y)
481
  output : Tensor(out)
Z
zyfncg 已提交
482 483 484 485 486
  infer_meta :
    func : CompareInferMeta
  kernel :
    func : greater_than

487
- op : hardswish
488
  args : (Tensor x)
C
cyber-pioneer 已提交
489
  output : Tensor(out)
Z
zyfncg 已提交
490 491 492 493
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
Z
zyfncg 已提交
494
    func : hardswish
495
  backward : hardswish_grad
Z
zyfncg 已提交
496

497
- op : hsigmoid_loss
Z
zhangyuqin1998 已提交
498
  args : (Tensor x, Tensor label, Tensor w, Tensor bias, Tensor path, Tensor code, int num_classes, bool is_sparse)
499 500 501 502 503 504 505 506 507
  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

508
- op : increment
509
  args : (Tensor x, float value = 1.0)
510
  output : Tensor(out)
Z
zyfncg 已提交
511 512 513 514
  infer_meta :
    func : IncrementInferMeta
  kernel :
    func : increment
H
hong 已提交
515
  inplace : (x -> out)
Z
zyfncg 已提交
516

517
- op : less_equal
518
  args : (Tensor x, Tensor y)
519
  output : Tensor(out)
Z
zyfncg 已提交
520 521 522 523 524
  infer_meta :
    func : CompareInferMeta
  kernel :
    func : less_equal

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

533
- op : linspace
534
  args : (Tensor start, Tensor stop, Tensor number, DataType dtype, Place place)
535
  output : Tensor(out)
Z
zyfncg 已提交
536 537
  infer_meta :
    func : LinspaceInferMeta
538
    param: [start, stop, number, dtype]
Z
zyfncg 已提交
539 540
  kernel :
    func : linspace
541
    param: [start, stop, number, dtype]
Z
zyfncg 已提交
542
    data_type : dtype
543
    backend : place
Z
zyfncg 已提交
544

C
Chen Weihang 已提交
545 546 547 548 549 550 551 552 553 554 555 556
- 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

557
- op : logsumexp
Z
zyfncg 已提交
558 559 560 561 562 563 564 565
  args : (Tensor x, int64_t[] axis,  bool keepdim,  bool reduce_all)
  output : Tensor(out)
  infer_meta :
    func : LogsumexpInferMeta
  kernel :
    func : logsumexp
  backward : logsumexp_grad

566
- op : matmul
Z
zyfncg 已提交
567 568 569 570 571 572 573 574
  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 已提交
575 576 577 578 579 580 581 582
- 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

583
- op : matrix_rank
Z
zhangyuqin1998 已提交
584
  args : (Tensor x, float tol, bool use_default_tol=true, bool hermitian=false)
Z
zyfncg 已提交
585 586 587
  output : Tensor(out)
  infer_meta :
    func : MatrixRankInferMeta
Z
zhangyuqin1998 已提交
588
    param : [x, use_default_tol, hermitian]
Z
zyfncg 已提交
589 590 591
  kernel :
    func : matrix_rank

592
- op : matrix_rank_tol
Z
zyfncg 已提交
593 594 595 596 597 598 599
  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

600
- op : max
601
  args : (Tensor x, IntArray axis={}, bool keepdim=false)
Z
zyfncg 已提交
602 603
  output : Tensor(out)
  infer_meta :
604
    func : ReduceIntArrayAxisInferMeta
Z
zyfncg 已提交
605 606 607 608
  kernel :
    func : max
  backward : max_grad

609
- op : maximum
Z
zyfncg 已提交
610 611 612 613 614 615 616 617
  args : (Tensor x, Tensor y)
  output : Tensor(out)
  infer_meta :
    func : ElementwiseInferMeta
  kernel :
    func : maximum
  backward : maximum_grad

618
- op : mean
619
  args : (Tensor x, IntArray axis={}, bool keepdim=false)
Z
zyfncg 已提交
620 621
  output : Tensor(out)
  infer_meta :
622
    func : ReduceIntArrayAxisInferMeta
Z
zyfncg 已提交
623 624 625 626
  kernel :
    func : mean
  backward : mean_grad

H
hong 已提交
627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644
- 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

645
- op : min
646
  args : (Tensor x, IntArray axis={}, bool keepdim=false)
Z
zyfncg 已提交
647 648
  output : Tensor(out)
  infer_meta :
649
    func : ReduceIntArrayAxisInferMeta
Z
zyfncg 已提交
650 651 652 653
  kernel :
    func : min
  backward : min_grad

654
- op : minimum
Z
zyfncg 已提交
655 656 657 658 659 660 661 662
  args : (Tensor x, Tensor y)
  output : Tensor(out)
  infer_meta :
    func : ElementwiseInferMeta
  kernel :
    func : minimum
  backward : minimum_grad

663
- op : mish
Z
zyfncg 已提交
664 665 666 667 668 669 670 671 672
  args : (Tensor x, float lambda)
  output : Tensor
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : mish
  backward : mish_grad

673
- op : multiply
Z
zyfncg 已提交
674 675 676 677 678
  args : (Tensor x, Tensor y)
  output : Tensor
  infer_meta :
    func : ElementwiseInferMeta
  kernel :
679 680
    func : multiply {dense, dense -> dense},
           multiply_sr {selected_rows, dense -> selected_rows}
681
  inplace : (x -> out)
Z
zyfncg 已提交
682 683
  backward : multiply_grad

684
- op : norm
Z
zyfncg 已提交
685 686 687 688 689 690 691 692
  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

693
- op : not_equal
694
  args : (Tensor x, Tensor y)
695
  output : Tensor(out)
Z
zyfncg 已提交
696 697 698 699 700
  infer_meta :
    func : CompareInferMeta
  kernel :
    func : not_equal

701
- op : one_hot
Z
zyfncg 已提交
702
  args : (Tensor x, Scalar(int) num_classes)
703
  output : Tensor(out)
Z
zyfncg 已提交
704 705 706 707 708
  infer_meta :
    func : OneHotInferMeta
  kernel :
    func : one_hot

709
- op : ones
710
  args : (IntArray shape, DataType dtype=DataType::FLOAT32, Place place=CPUPlace())
711
  output : Tensor(out)
712 713
  invoke : full(shape, 1, dtype, place)

714
- op : ones_like
Z
zyfncg 已提交
715
  args : (Tensor x, DataType dtype=DataType::UNDEFINED, Place place={})
716
  output : Tensor(out)
Z
zyfncg 已提交
717 718
  invoke : full_like(x, 1, dtype, place)

719
- op : pad
720
  args : (Tensor x, int[] paddings, Scalar pad_value)
Z
zyfncg 已提交
721 722 723 724 725 726 727
  output : Tensor
  infer_meta :
    func : PadInferMeta
  kernel :
    func : pad
  backward : pad_grad

728
- op : pool2d
729
  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 已提交
730 731
  output : Tensor(out)
  infer_meta :
732
    func : Pool2DInferMeta
733
    param : [x, kernel_size, strides, paddings, ceil_mode, exclusive, data_format, pooling_type, global_pooling, adaptive, padding_algorithm]
Z
zyfncg 已提交
734 735
  kernel :
    func : pool2d
736
    param : [x, kernel_size, strides, paddings, ceil_mode, exclusive, data_format, pooling_type, global_pooling, adaptive, padding_algorithm]
Z
zyfncg 已提交
737 738
  backward : pool2d_grad

739
- op : pool3d
740
  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 已提交
741 742 743
  output : Tensor(out)
  infer_meta :
    func : PoolInferMeta
744
    param : [x, kernel_size, strides, paddings, ceil_mode, exclusive, data_format, pooling_type, global_pooling, adaptive, padding_algorithm]
Z
zyfncg 已提交
745 746
  kernel :
    func : pool3d
747
    param : [x, kernel_size, strides, paddings, ceil_mode, exclusive, data_format, pooling_type, global_pooling, adaptive, padding_algorithm]
Z
zyfncg 已提交
748 749
  backward : pool3d_grad

750 751 752 753 754 755
- op : prod
  args : (Tensor x, IntArray dims, bool keep_dim, bool reduce_all)
  output : Tensor
  infer_meta :
    func : ReduceIntArrayAxisInferMetaBase
  kernel :
756
    func : prod
757 758
  backward : prod_grad

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

771
- op : randperm
Z
zyfncg 已提交
772
  args : (int n, DataType dtype, Place place={})
773
  output : Tensor(out)
Z
zyfncg 已提交
774 775 776 777 778 779 780 781 782
  infer_meta :
    func : RandpermInferMeta
    param : [n, dtype]
  kernel :
    func : randperm
    param : [n, dtype]
    data_type : dtype
    backend : place

783
- op : remainder
C
Chen Weihang 已提交
784
  args : (Tensor x, Tensor y)
785
  output : Tensor (out)
C
Chen Weihang 已提交
786 787 788 789 790 791
  infer_meta :
    func : ElementwiseInferMeta
  kernel :
    func : remainder
  inplace : (x -> out)

792
- op : repeat_interleave
793
  args : (Tensor x, int repeats, int axis)
S
seemingwang 已提交
794 795 796 797 798 799 800
  output : Tensor(out)
  infer_meta :
    func : RepeatInterleaveInferMeta
  kernel :
    func : repeat_interleave
  backward: repeat_interleave_grad

801
- op : repeat_interleave_with_tensor_index
802
  args : (Tensor x, Tensor repeats, int axis)
S
seemingwang 已提交
803 804 805 806 807 808 809 810
  output : Tensor(out)
  infer_meta :
    func : RepeatInterleaveWithTensorIndexInferMeta
  kernel :
    func : repeat_interleave_with_tensor_index
    data_type : x
  backward: repeat_interleave_with_tensor_index_grad

811
- op : reshape
Z
zyfncg 已提交
812 813 814 815 816
  args : (Tensor x, IntArray shape)
  output : Tensor(out), Tensor(xshape)
  infer_meta :
    func : ReshapeWithXShapeInferMeta
  kernel :
817
    func : reshape
Z
zyfncg 已提交
818 819 820 821 822
  inplace : (x -> out)
  view: (x -> out)
  intermediate : xshape
  backward: reshape_grad

823 824 825 826 827 828 829 830 831 832 833 834 835 836 837
- 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 已提交
838 839 840 841 842 843 844 845 846 847 848
- 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

849
- op : slice
Z
zyfncg 已提交
850 851 852 853 854 855 856 857
  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

858
- op : softmax
Z
zyfncg 已提交
859
  args : (Tensor x, int axis)
860
  output : Tensor(out)
Z
zyfncg 已提交
861 862 863 864
  infer_meta :
    func : SoftmaxInferMeta
  kernel :
    func : softmax
865
  inplace : (x -> out)
Z
zyfncg 已提交
866 867
  backward : softmax_grad

868
- op : split
C
Charles-hit 已提交
869 870 871 872 873 874
  args : (Tensor x, IntArray sections, Scalar(int) axis)
  output : Tensor[]{sections.size()}
  infer_meta :
    func : SplitInferMeta
  kernel :
    func : split
Z
zyfncg 已提交
875 876
  backward : split_grad

877
- op : split_with_num
C
Charles-hit 已提交
878 879 880 881 882 883 884 885
  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

886
- op : strided_slice
Z
zyfncg 已提交
887 888 889 890 891 892 893 894
  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

895
- op : subtract
Z
zyfncg 已提交
896
  args : (Tensor x, Tensor y)
897
  output : Tensor(out)
Z
zyfncg 已提交
898 899 900 901
  infer_meta :
    func : ElementwiseInferMeta
  kernel :
    func : subtract
902
  inplace : (x -> out)
Z
zyfncg 已提交
903 904
  backward : subtract_grad

905
- op : sum
906
  args : (Tensor x, IntArray axis={}, DataType dtype=DataType::UNDEFINED, bool keepdim=false)
Z
zyfncg 已提交
907 908 909 910 911 912 913 914
  output : Tensor(out)
  infer_meta :
    func : SumInferMeta
  kernel :
    func : sum
    data_type : x
  backward : sum_grad

915
- op : swish
916
  args : (Tensor x)
Z
zyfncg 已提交
917 918 919 920 921 922 923 924
  output : Tensor(out)
  infer_meta :
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : swish
  backward : swish_grad

925
- op : sync_batch_norm_
926
  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)
927 928 929 930 931
  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
932
    data_type : x
933
  backward : sync_batch_norm_grad
934
  inplace : (mean -> mean_out), (variance -> variance_out)
W
wanghuancoder 已提交
935
  optional : reserve_space
936

937
- op : tile
938 939
  args : (Tensor x, IntArray repeat_times = {})
  output : Tensor(out)
Z
zyfncg 已提交
940 941 942 943 944 945
  infer_meta :
    func : TileInferMeta
  kernel :
    func : tile
  backward : tile_grad

N
niuliling123 已提交
946 947 948 949 950 951 952 953 954
- op : trans_layout
  args : (Tensor x, int[] perm)
  output : Tensor
  infer_meta :
    func : TransposeInferMeta
  kernel :
    func : transpose
  backward : trans_layout_grad

955
- op : transpose
956
  args : (Tensor x, int[] perm)
957
  output : Tensor(out)
Z
zyfncg 已提交
958 959 960 961 962 963
  infer_meta :
    func : TransposeInferMeta
  kernel :
    func : transpose
  backward : transpose_grad

964
- op : tril
Z
zyfncg 已提交
965
  args : (Tensor x, int diagonal)
966 967 968 969 970
  output : Tensor(out)
  infer_meta :
    func : TrilInferMeta
  kernel :
    func : tril
971
  inplace: (x -> out)
972 973
  backward : tril_grad

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

986
- op : triu
Z
zyfncg 已提交
987
  args : (Tensor x, int diagonal)
988 989 990 991 992
  output : Tensor(out)
  infer_meta :
    func : TriuInferMeta
  kernel :
    func : triu
993
  inplace: (x -> out)
994 995
  backward : triu_grad

996
- op : triu_indices
997 998 999 1000 1001 1002 1003 1004 1005 1006 1007
  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 已提交
1008
# python API: paddle.nn.initializer.TruncatedNormal
1009
- op : truncated_gaussian_random
Z
zyfncg 已提交
1010
  args : (int[] shape, float mean, float std, int seed, DataType dtype=DataType::FLOAT32, Place place={})
1011
  output : Tensor(out)
Z
zyfncg 已提交
1012 1013 1014 1015 1016 1017 1018 1019 1020
  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

1021
- op : uniform
1022
  args : (IntArray shape,  DataType dtype,  Scalar min,  Scalar max,  int seed, Place place={})
Z
zyfncg 已提交
1023 1024 1025
  output : Tensor(out)
  infer_meta :
    func : UniformRandomInferMeta
1026
    param: [shape, dtype]
Z
zyfncg 已提交
1027
  kernel :
1028
    func : uniform
Z
zyfncg 已提交
1029 1030 1031 1032 1033
    param: [shape, dtype, min, max, seed]
    data_type : dtype
    backend : place

# The `axis` argument of Python API paddle.unique is not vector
1034
- op : unique
Z
zyfncg 已提交
1035 1036 1037 1038 1039 1040 1041
  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
1042
  optional : indices, inverse, counts
Z
zyfncg 已提交
1043

1044 1045 1046 1047 1048 1049 1050 1051 1052 1053
- 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

1054
- op : zeros
1055
  args : (IntArray shape, DataType dtype=DataType::FLOAT32, Place place=CPUPlace())
1056
  output : Tensor(out)
1057 1058
  invoke : full(shape, 0, dtype, place)

1059
- op : zeros_like
Z
zyfncg 已提交
1060
  args : (Tensor x, DataType dtype=DataType::UNDEFINED, Place place = {})
1061
  output : Tensor(out)
Z
zyfncg 已提交
1062
  invoke : full_like(x, 0, dtype, place)