From 2006fbc4f90cecb25ca9e1a4decc9773b3cef0bf Mon Sep 17 00:00:00 2001 From: zhupengyang Date: Fri, 27 Aug 2021 15:37:25 +0800 Subject: [PATCH] gelu/logsigmoid add AsExtra (#35198) --- paddle/fluid/operators/activation_op.cc | 6 ++++-- paddle/fluid/operators/gelu_op.cc | 9 ++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/paddle/fluid/operators/activation_op.cc b/paddle/fluid/operators/activation_op.cc index 4a12ceb13ab..7b98da04bc3 100644 --- a/paddle/fluid/operators/activation_op.cc +++ b/paddle/fluid/operators/activation_op.cc @@ -49,11 +49,13 @@ static constexpr bool CanInplaceAct() { " operator, a Tensor with shape same as input."); \ AddAttr("use_mkldnn", \ "(bool, default false) Only used in mkldnn kernel") \ - .SetDefault(false); \ + .SetDefault(false) \ + .AsExtra(); \ AddAttr("use_cudnn", \ "(bool, default false) Only used in cudnn kernel, need " \ "install cudnn") \ - .SetDefault(false); \ + .SetDefault(false) \ + .AsExtra(); \ AddComment(OP_COMMENT); \ } \ } diff --git a/paddle/fluid/operators/gelu_op.cc b/paddle/fluid/operators/gelu_op.cc index 3293800e1c6..3d338f00d4f 100644 --- a/paddle/fluid/operators/gelu_op.cc +++ b/paddle/fluid/operators/gelu_op.cc @@ -108,16 +108,19 @@ class GeluOpMaker : public framework::OpProtoAndCheckerMaker { .SetDefault(false); 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", "int8", "bfloat16"}); + .InEnum({"float32", "int8", "bfloat16"}) + .AsExtra(); AddAttr("use_cudnn", "(bool, default false) Only used in cudnn kernel, need " "install cudnn") - .SetDefault(false); + .SetDefault(false) + .AsExtra(); AddComment(R"DOC( Gelu Activation Operator. -- GitLab