未验证 提交 b211f02b 编写于 作者: P Pei Yang 提交者: GitHub

add as-extra for softplus/leaky_relu/softmax (#35493)

上级 cc6d2b07
......@@ -415,7 +415,8 @@ class LeakyReluOpMaker : public framework::OpProtoAndCheckerMaker {
.SetDefault(0.02f);
AddAttr<bool>("use_mkldnn",
"(bool, default false) Only used in mkldnn kernel")
.SetDefault(false);
.SetDefault(false)
.AsExtra();
AddComment(R"DOC(
LeakyRelu Activation Operator.
......@@ -439,11 +440,13 @@ class SoftplusOpMaker : public framework::OpProtoAndCheckerMaker {
.SetDefault(20.0f);
AddAttr<bool>("use_mkldnn",
"(bool, default false) Only used in mkldnn kernel.")
.SetDefault(false);
.SetDefault(false)
.AsExtra();
AddAttr<bool>(
"use_cudnn",
"(bool, default false) Only used in cudnn kernel, need install cudnn.")
.SetDefault(false);
.SetDefault(false)
.AsExtra();
AddComment(R"DOC(
:strong:`Softplus Activation Operator`
......
......@@ -110,7 +110,8 @@ class SoftmaxOpMaker : public framework::OpProtoAndCheckerMaker {
AddAttr<bool>(
"use_cudnn",
"(bool, default false) Only used in cudnn kernel, need install cudnn")
.SetDefault(false);
.SetDefault(false)
.AsExtra();
AddAttr<std::string>(
"data_format",
"(string, default NCHW) Only used in "
......@@ -120,16 +121,19 @@ class SoftmaxOpMaker : public framework::OpProtoAndCheckerMaker {
.SetDefault("AnyLayout");
AddAttr<bool>("use_mkldnn",
"(bool, default false) Only used in mkldnn kernel")
.SetDefault(false);
.SetDefault(false)
.AsExtra();
AddAttr<std::string>(
"mkldnn_data_type",
"(string, default \"float32\"). Data type of mkldnn kernel")
.SetDefault("float32")
.InEnum({"float32", "bfloat16"});
.InEnum({"float32", "bfloat16"})
.AsExtra();
AddAttr<bool>("is_test",
"(bool, default false) Set to true for inference only, false "
"for training. Some layers may run faster when this is true.")
.SetDefault(false);
.SetDefault(false)
.AsExtra();
AddComment(R"DOC(
Softmax Operator.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册