Skip to content

Commit f534291

Browse files
authored
static graph autogen code for shape op (PaddlePaddle#54221)
* static graph autogen code for shape op * fix onednn * fix onednn
1 parent c642aa1 commit f534291

File tree

6 files changed

+20
-95
lines changed

6 files changed

+20
-95
lines changed

paddle/fluid/operators/shape_op.cc

Lines changed: 0 additions & 82 deletions
This file was deleted.

paddle/phi/api/yaml/legacy_ops.yaml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -903,17 +903,6 @@
903903
intermediate : noise
904904
backward : rrelu_grad
905905

906-
- op : shape
907-
args : (Tensor input)
908-
output : Tensor(out)
909-
infer_meta :
910-
func : ShapeInferMeta
911-
kernel :
912-
func : shape {dense -> dense},
913-
shape_sr {selected_rows -> selected_rows}
914-
data_transform:
915-
skip_transform : input
916-
917906
- op : slice
918907
args : (Tensor input, int64_t[] axes, IntArray starts, IntArray ends, int64_t[] infer_flags, int64_t[] decrease_axis)
919908
output : Tensor

paddle/phi/api/yaml/op_compat.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2135,6 +2135,12 @@
21352135
extra :
21362136
attrs : [bool use_mkldnn=false]
21372137

2138+
- op : shape
2139+
inputs :
2140+
input : Input
2141+
outputs :
2142+
out : Out
2143+
21382144
- op : shape
21392145
extra :
21402146
attrs : [bool use_mkldnn = false, str mkldnn_data_type = "float32"]

paddle/phi/api/yaml/ops.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1959,6 +1959,17 @@
19591959
optional : master_param, master_param_out
19601960
inplace : (param -> param_out), (master_param -> master_param_out)
19611961

1962+
- op : shape
1963+
args : (Tensor input)
1964+
output : Tensor(out)
1965+
infer_meta :
1966+
func : ShapeInferMeta
1967+
kernel :
1968+
func : shape {dense -> dense},
1969+
shape_sr {selected_rows -> selected_rows}
1970+
data_transform:
1971+
skip_transform : input
1972+
19621973
- op : shard_index
19631974
args : (Tensor input, int index_num, int nshards, int shard_id, int ignore_value=-1)
19641975
output : Tensor(out)

paddle/phi/kernels/onednn/shape_kernel.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,6 @@ PD_REGISTER_KERNEL(shape,
5656
float,
5757
phi::dtype::bfloat16,
5858
int8_t,
59-
uint8_t) {}
59+
uint8_t) {
60+
kernel->InputAt(0).SetBackend(phi::Backend::ALL_BACKEND);
61+
}

test/cpp/fluid/mkldnn/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ cc_test_old(
4242
recurrent_op
4343
op_registry
4444
pool_op
45-
shape_op
4645
crop_op
4746
activation_op
4847
generated_op

0 commit comments

Comments
 (0)