From 70a9b6522bdbd8ce36be763d8c2866fc8095f1b9 Mon Sep 17 00:00:00 2001 From: feng_shuai Date: Mon, 6 Sep 2021 13:54:54 +0800 Subject: [PATCH] transpose/slice/stride_slice/squeeze/unsqueeze op_def_enhance-1.0 (#35391) * transpose/slice/stride_slice/squeeze/unsqueeze op_def_enhance-1.0 * delete infer_flags and decrease-axis * delet infer_flags and decrea_axis --- paddle/fluid/operators/slice_op.cc | 6 ++++-- paddle/fluid/operators/squeeze_op.cc | 6 ++++-- paddle/fluid/operators/transpose_op.cc | 6 ++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/paddle/fluid/operators/slice_op.cc b/paddle/fluid/operators/slice_op.cc index ac50ccea9ee..2a13998b4f6 100644 --- a/paddle/fluid/operators/slice_op.cc +++ b/paddle/fluid/operators/slice_op.cc @@ -238,12 +238,14 @@ class SliceOpMaker : public framework::OpProtoAndCheckerMaker { .SetDefault({}); AddAttr("use_mkldnn", "(bool, default false) Only used in mkldnn kernel") - .SetDefault(false); + .SetDefault(false) + .AsExtra(); AddAttr( "mkldnn_data_type", "(string, default \"float32\"). Data type of mkldnn kernel") .SetDefault("float32") - .InEnum({"float32", "bfloat16"}); + .InEnum({"float32", "bfloat16"}) + .AsExtra(); AddComment(R"DOC( Slice Operator. diff --git a/paddle/fluid/operators/squeeze_op.cc b/paddle/fluid/operators/squeeze_op.cc index 866431951f0..e13245797cf 100644 --- a/paddle/fluid/operators/squeeze_op.cc +++ b/paddle/fluid/operators/squeeze_op.cc @@ -162,12 +162,14 @@ class SqueezeOpMaker : public framework::OpProtoAndCheckerMaker { .SetDefault({}); AddAttr("use_mkldnn", "(bool, default false) Only used in mkldnn kernel") - .SetDefault(false); + .SetDefault(false) + .AsExtra(); AddAttr( "mkldnn_data_type", "(string, default \"float32\"). Data type of mkldnn kernel") .SetDefault("float32") - .InEnum({"float32", "bfloat16"}); + .InEnum({"float32", "bfloat16"}) + .AsExtra(); AddComment(R"DOC( Squeeze Operator. diff --git a/paddle/fluid/operators/transpose_op.cc b/paddle/fluid/operators/transpose_op.cc index 18ee5d71541..aa606693fed 100644 --- a/paddle/fluid/operators/transpose_op.cc +++ b/paddle/fluid/operators/transpose_op.cc @@ -133,12 +133,14 @@ class TransposeOpMaker : public framework::OpProtoAndCheckerMaker { "use_quantizer", "(bool, default false) " "This parameter is no longer used. Use 'mkldnn_data_type' instead.") - .SetDefault(false); + .SetDefault(false) + .AsExtra(); AddAttr( "mkldnn_data_type", "(string, default \"float32\"). Data type of mkldnn kernel") .SetDefault("float32") - .InEnum({"float32", "int8", "bfloat16"}); + .InEnum({"float32", "int8", "bfloat16"}) + .AsExtra(); /* int8 parameters */ AddComment(R"DOC( Transpose Operator. -- GitLab