Skip to content

Commit 2006fbc

Browse files
authored
gelu/logsigmoid add AsExtra (#35198)
1 parent ad52248 commit 2006fbc

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

paddle/fluid/operators/activation_op.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,13 @@ static constexpr bool CanInplaceAct() {
4949
" operator, a Tensor with shape same as input."); \
5050
AddAttr<bool>("use_mkldnn", \
5151
"(bool, default false) Only used in mkldnn kernel") \
52-
.SetDefault(false); \
52+
.SetDefault(false) \
53+
.AsExtra(); \
5354
AddAttr<bool>("use_cudnn", \
5455
"(bool, default false) Only used in cudnn kernel, need " \
5556
"install cudnn") \
56-
.SetDefault(false); \
57+
.SetDefault(false) \
58+
.AsExtra(); \
5759
AddComment(OP_COMMENT); \
5860
} \
5961
}

paddle/fluid/operators/gelu_op.cc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,16 +108,19 @@ class GeluOpMaker : public framework::OpProtoAndCheckerMaker {
108108
.SetDefault(false);
109109
AddAttr<bool>("use_mkldnn",
110110
"(bool, default false) Only used in mkldnn kernel")
111-
.SetDefault(false);
111+
.SetDefault(false)
112+
.AsExtra();
112113
AddAttr<std::string>(
113114
"mkldnn_data_type",
114115
"(string, default \"float32\"). Data type of mkldnn kernel")
115116
.SetDefault("float32")
116-
.InEnum({"float32", "int8", "bfloat16"});
117+
.InEnum({"float32", "int8", "bfloat16"})
118+
.AsExtra();
117119
AddAttr<bool>("use_cudnn",
118120
"(bool, default false) Only used in cudnn kernel, need "
119121
"install cudnn")
120-
.SetDefault(false);
122+
.SetDefault(false)
123+
.AsExtra();
121124
AddComment(R"DOC(
122125
Gelu Activation Operator.
123126

0 commit comments

Comments
 (0)