Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
22f042ba
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2298
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
22f042ba
编写于
9月 06, 2022
作者:
Z
zyfncg
提交者:
GitHub
9月 06, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
clear extra attrs of some op in opmaker (#45758)
上级
dd0f9b96
变更
8
显示空白变更内容
内联
并排
Showing
8 changed file
with
70 addition
and
72 deletion
+70
-72
paddle/fluid/operators/rnn_op.cc
paddle/fluid/operators/rnn_op.cc
+0
-3
paddle/fluid/operators/seed_op.cc
paddle/fluid/operators/seed_op.cc
+0
-17
paddle/fluid/operators/shape_op.cc
paddle/fluid/operators/shape_op.cc
+0
-10
paddle/fluid/operators/shuffle_channel_op.cc
paddle/fluid/operators/shuffle_channel_op.cc
+0
-5
paddle/fluid/operators/slice_op.cc
paddle/fluid/operators/slice_op.cc
+0
-10
paddle/fluid/operators/softmax_op.cc
paddle/fluid/operators/softmax_op.cc
+0
-20
paddle/fluid/operators/squeeze_op.cc
paddle/fluid/operators/squeeze_op.cc
+33
-2
paddle/phi/api/yaml/api_compat.yaml
paddle/phi/api/yaml/api_compat.yaml
+37
-5
未找到文件。
paddle/fluid/operators/rnn_op.cc
浏览文件 @
22f042ba
...
...
@@ -103,9 +103,6 @@ class RNNOpMaker : public framework::OpProtoAndCheckerMaker {
"mode"
,
"(string) rnn types, including: LSTM, GRU, RNN_RELU, RNN_TANH."
);
AddAttr
<
int
>
(
"seed"
,
"seed to used if fix_seed is True"
).
SetDefault
(
0
);
AddAttr
<
bool
>
(
"is_test"
,
"True if in test phase."
)
.
SetDefault
(
false
)
.
AsExtra
();
AddComment
(
R"DOC(
)DOC"
);
}
...
...
paddle/fluid/operators/seed_op.cc
浏览文件 @
22f042ba
...
...
@@ -39,23 +39,6 @@ class SeedOpMaker : public framework::OpProtoAndCheckerMaker {
void
Make
()
override
{
AddOutput
(
"Out"
,
"The output of seed op."
);
AddAttr
<
int
>
(
"seed"
,
"Dropout random seed."
).
SetDefault
(
0
);
AddAttr
<
bool
>
(
"deterministic"
,
"(bool, default false) Whether to use deterministic "
"RandomSeedGenerator which "
"generate by `set_random_seed_generator`"
)
.
SetDefault
(
false
)
.
AsExtra
();
AddAttr
<
std
::
string
>
(
"rng_name"
,
"use deterministic RandomSeedGenerator which name is `rng_name`"
)
.
SetDefault
(
""
)
.
AsExtra
();
AddAttr
<
bool
>
(
"force_cpu"
,
"(bool, default false) Force fill output variable to cpu "
"memory. Otherwise, fill output variable to the running "
"device"
)
.
SetDefault
(
false
)
.
AsExtra
();
AddComment
(
R"DOC(
Seed Operator.
)DOC"
);
...
...
paddle/fluid/operators/shape_op.cc
浏览文件 @
22f042ba
...
...
@@ -66,16 +66,6 @@ Shape Operator.
Return the shape of the input.
)DOC"
);
AddAttr
<
bool
>
(
"use_mkldnn"
,
"(bool, default false) Only used in mkldnn kernel"
)
.
SetDefault
(
false
)
.
AsExtra
();
AddAttr
<
std
::
string
>
(
"mkldnn_data_type"
,
"(string, default
\"
float32
\"
). Data type of mkldnn kernel"
)
.
SetDefault
(
"float32"
)
.
InEnum
({
"float32"
,
"bfloat16"
,
"int8"
})
.
AsExtra
();
}
};
...
...
paddle/fluid/operators/shuffle_channel_op.cc
浏览文件 @
22f042ba
...
...
@@ -69,11 +69,6 @@ class ShuffleChannelOpMaker : public framework::OpProtoAndCheckerMaker {
platform
::
errors
::
InvalidArgument
(
"group should be larger than 0."
));
});
AddAttr
<
bool
>
(
"use_mkldnn"
,
"(bool, default false) Only used in mkldnn kernel"
)
.
SetDefault
(
false
)
.
AsExtra
();
AddComment
(
R"DOC(
Shuffle Channel operator
This opearator shuffles the channels of input x.
...
...
paddle/fluid/operators/slice_op.cc
浏览文件 @
22f042ba
...
...
@@ -260,16 +260,6 @@ class SliceOpMaker : public framework::OpProtoAndCheckerMaker {
.
SetDefault
({});
AddAttr
<
std
::
vector
<
int
>>
(
"decrease_axis"
,
"(list<int>) decrease_axis"
)
.
SetDefault
({});
AddAttr
<
bool
>
(
"use_mkldnn"
,
"(bool, default false) Only used in mkldnn kernel"
)
.
SetDefault
(
false
)
.
AsExtra
();
AddAttr
<
std
::
string
>
(
"mkldnn_data_type"
,
"(string, default
\"
float32
\"
). Data type of mkldnn kernel"
)
.
SetDefault
(
"float32"
)
.
InEnum
({
"float32"
,
"int8"
,
"bfloat16"
})
.
AsExtra
();
AddComment
(
R"DOC(
Slice Operator.
...
...
paddle/fluid/operators/softmax_op.cc
浏览文件 @
22f042ba
...
...
@@ -85,11 +85,6 @@ class SoftmaxOpMaker : public framework::OpProtoAndCheckerMaker {
"The dimension index of Input(x) to perform softmax,"
"default -1 for last dimension"
)
.
SetDefault
(
-
1
);
AddAttr
<
bool
>
(
"use_cudnn"
,
"(bool, default false) Only used in cudnn kernel, need install cudnn"
)
.
SetDefault
(
false
)
.
AsExtra
();
AddAttr
<
std
::
string
>
(
"data_format"
,
"(string, default NCHW) Only used in "
...
...
@@ -97,21 +92,6 @@ class SoftmaxOpMaker : public framework::OpProtoAndCheckerMaker {
"Defaults to
\"
NHWC
\"
. Specify the data format of the output data, "
"the input will be transformed automatically. "
)
.
SetDefault
(
"AnyLayout"
);
AddAttr
<
bool
>
(
"use_mkldnn"
,
"(bool, default false) Only used in mkldnn kernel"
)
.
SetDefault
(
false
)
.
AsExtra
();
AddAttr
<
std
::
string
>
(
"mkldnn_data_type"
,
"(string, default
\"
float32
\"
). Data type of mkldnn kernel"
)
.
SetDefault
(
"float32"
)
.
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
)
.
AsExtra
();
AddComment
(
R"DOC(
Softmax Operator.
...
...
paddle/fluid/operators/squeeze_op.cc
浏览文件 @
22f042ba
...
...
@@ -296,15 +296,46 @@ class SqueezeDoubleGradOpMaker : public framework::SingleGradOpMaker<T> {
// squeeze_grad, in this way, the framework can reuse the memory of X
// immediately the squeeze2_op is finished.
// Considering compatibility issues, we could not fix squeeze2_op
class
Squeeze2OpMaker
:
public
SqueezeOp
Maker
{
class
Squeeze2OpMaker
:
public
framework
::
OpProtoAndChecker
Maker
{
public:
void
Make
()
override
{
SqueezeOpMaker
::
Make
();
AddInput
(
"X"
,
"(Tensor). The input tensor of squeeze operator."
);
AddOutput
(
"Out"
,
"(Tensor). The output tensor of squeeze operator."
);
AddOutput
(
"XShape"
,
"XShape is just used to store the shape and lod of X, which will "
"be used in SqueezeGradOp."
)
.
AsIntermediate
()
.
AsExtra
();
AddAttr
<
std
::
vector
<
int
>>
(
"axes"
,
"(std::vector<int>). List of integers,"
" indicating the dimensions to squeeze."
)
.
SetDefault
({})
.
SupportTensor
();
AddComment
(
R"DOC(
Squeeze2 Operator.
Remove single-dimensional entries from the shape of a tensor.
Takes a parameter axes with a list of axes to squeeze.
If axes is not provided, all the single dimensions will be removed from the shape.
If an axis is selected with shape entry not equal to one, an error is raised.
Examples:
Case 1:
Given
X.shape = (1, 3, 1, 5)
and
axes = [0]
we get:
Out.shape = (3, 1, 5)
Case 2:
Given
X.shape = (1, 3, 1, 5)
and
axes = []
we get:
Out.shape = (3, 5)
)DOC"
);
}
};
...
...
paddle/phi/api/yaml/api_compat.yaml
浏览文件 @
22f042ba
...
...
@@ -281,22 +281,54 @@
outputs
:
out
:
Out
-
api
:
prelu
backward
:
prelu_grad
extra
:
attrs
:
[
bool use_mkldnn = false
,
str mkldnn_data_type = "float32"
,
bool is_test = false
]
-
api
:
renorm
backward
:
renorm_grad
extra
:
attrs
:
[
bool use_mkldnn = false
,
bool use_cudnn = false
]
-
api
:
rnn
backward
:
rnn_grad
extra
:
attrs
:
[
bool is_test = false
]
-
api
:
seed
extra
:
attrs
:
[
bool deterministic = false
,
str rng_name = ""
,
bool force_cpu = false
]
-
api
:
shape
extra
:
attrs
:
[
bool use_mkldnn = false
,
str mkldnn_data_type = "float32"
]
-
api
:
shuffle_channel
backward
:
shuffle_channel_grad
extra
:
attrs
:
[
bool use_mkldnn = false
]
-
api
:
slice
backward
:
slice_grad
extra
:
attrs
:
[
bool use_mkldnn = false
,
str mkldnn_data_type = "float32"
]
-
api
:
softmax
backward
:
softmax_grad
extra
:
attrs
:
[
bool use_cudnn = false
,
bool use_mkldnn = false
,
str mkldnn_data_type = "float32"
,
bool is_test = false
]
-
api
:
prelu
backward
:
prelu_grad
extra
:
attrs
:
[
bool use_mkldnn = false
,
str mkldnn_data_type = "float32"
,
bool is_test = false
]
-
api
:
solve
inputs
:
{
x
:
X
,
y
:
Y
}
outputs
:
out
:
Out
-
api
:
squeeze (squeeze2)
backward
:
squeeze_grad (squeeze2_grad)
extra
:
attrs
:
[
bool use_mkldnn = false
,
str mkldnn_data_type = "float32"
]
-
api
:
stack
backward
:
stack_grad
extra
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录