Skip to content

Commit

Permalink
support auto generate static for eye (#52370)
Browse files Browse the repository at this point in the history
  • Loading branch information
RedContritio authored Mar 31, 2023
1 parent 5e140d8 commit 20ee0d7
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 111 deletions.
3 changes: 1 addition & 2 deletions paddle/fluid/operators/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ endif()

set(OP_HEADER_DEPS ${OP_HEADER_DEPS} phi phi_utils backward_infermeta sparse_backward_infermeta static_prim_api get_expected_kernel_func)

register_operators(EXCLUDES py_func_op warpctc_op dgc_op generated_op1 generated_op2 generated_op3 generated_op4 load_combine_op lstm_op run_program_op eye_op quantize_linear_op
register_operators(EXCLUDES py_func_op warpctc_op dgc_op generated_op1 generated_op2 generated_op3 generated_op4 load_combine_op lstm_op run_program_op quantize_linear_op
recurrent_op save_combine_op sparse_attention_op sync_batch_norm_op activation_op ${OP_MKL_DEPS} DEPS ${OP_HEADER_DEPS})

op_library(generated_op UNITY SRCS generated_op1.cc generated_op2.cc generated_op3.cc generated_op4.cc DEPS ${OP_HEADER_DEPS})
Expand Down Expand Up @@ -140,7 +140,6 @@ if (WITH_MLU)
endif()

op_library(lstm_op DEPS ${OP_HEADER_DEPS} lstm_compute)
op_library(eye_op DEPS ${OP_HEADER_DEPS})
op_library(recurrent_op DEPS ${OP_HEADER_DEPS})

set(COMMON_OP_DEPS ${OP_HEADER_DEPS})
Expand Down
83 changes: 0 additions & 83 deletions paddle/fluid/operators/eye_op.cc

This file was deleted.

9 changes: 9 additions & 0 deletions paddle/phi/api/yaml/op_compat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,15 @@
extra :
attrs : [bool use_mkldnn = false, bool use_cudnn = false]

- op : eye
outputs :
out : Out
scalar :
num_rows :
support_tensor : true
num_columns :
support_tensor : true

- op : fake_channel_wise_quantize_abs_max
extra :
attrs : [int round_type = 1]
Expand Down
11 changes: 11 additions & 0 deletions paddle/phi/api/yaml/static_ops.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,17 @@
backend : x
force_backend : force_cpu

- op : eye
args : (Scalar(int64_t) num_rows, Scalar(int64_t) num_columns = -1, DataType dtype = DataType::FLOAT32)
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

- op : frobenius_norm
args : (Tensor x, IntArray axis={0}, bool keepdim=false, bool reduce_all=false, int in_dtype=-1, int out_dtype=-1)
output : Tensor(out)
Expand Down
26 changes: 0 additions & 26 deletions paddle/phi/ops/compat/eye_sig.cc

This file was deleted.

0 comments on commit 20ee0d7

Please sign in to comment.