Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
83424033
P
Paddle
项目概览
机器未来
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
83424033
编写于
9月 12, 2021
作者:
王
王明冬
提交者:
GitHub
9月 12, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix some op extra error, test=develop (#35667)
上级
adaa207b
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
9 addition
and
8 deletion
+9
-8
paddle/fluid/framework/operator.cc
paddle/fluid/framework/operator.cc
+2
-2
paddle/fluid/operators/conv_op.cc
paddle/fluid/operators/conv_op.cc
+5
-2
paddle/fluid/operators/lstm_op.cc
paddle/fluid/operators/lstm_op.cc
+1
-3
paddle/fluid/operators/transpose_op.cc
paddle/fluid/operators/transpose_op.cc
+1
-1
未找到文件。
paddle/fluid/framework/operator.cc
浏览文件 @
83424033
...
@@ -441,7 +441,7 @@ void OperatorBase::CheckAllInputOutputSet() const {
...
@@ -441,7 +441,7 @@ void OperatorBase::CheckAllInputOutputSet() const {
if
(
info_
==
nullptr
||
info_
->
proto_
==
nullptr
)
return
;
if
(
info_
==
nullptr
||
info_
->
proto_
==
nullptr
)
return
;
for
(
auto
&
in
:
info_
->
Proto
().
inputs
())
{
for
(
auto
&
in
:
info_
->
Proto
().
inputs
())
{
if
(
!
in
.
dispensable
())
{
if
(
!
in
.
dispensable
()
&&
!
in
.
extra
()
)
{
PADDLE_ENFORCE_NE
(
PADDLE_ENFORCE_NE
(
inputs_
.
find
(
in
.
name
()),
inputs_
.
end
(),
inputs_
.
find
(
in
.
name
()),
inputs_
.
end
(),
platform
::
errors
::
NotFound
(
"Operator %s's input (%s) is not set."
,
platform
::
errors
::
NotFound
(
"Operator %s's input (%s) is not set."
,
...
@@ -450,7 +450,7 @@ void OperatorBase::CheckAllInputOutputSet() const {
...
@@ -450,7 +450,7 @@ void OperatorBase::CheckAllInputOutputSet() const {
}
}
for
(
auto
&
out
:
info_
->
Proto
().
outputs
())
{
for
(
auto
&
out
:
info_
->
Proto
().
outputs
())
{
if
(
!
out
.
dispensable
())
{
if
(
!
out
.
dispensable
()
&&
!
out
.
extra
()
)
{
PADDLE_ENFORCE_NE
(
PADDLE_ENFORCE_NE
(
outputs_
.
find
(
out
.
name
()),
outputs_
.
end
(),
outputs_
.
find
(
out
.
name
()),
outputs_
.
end
(),
platform
::
errors
::
NotFound
(
"Operator %s's output (%s) is not set."
,
platform
::
errors
::
NotFound
(
"Operator %s's output (%s) is not set."
,
...
...
paddle/fluid/operators/conv_op.cc
浏览文件 @
83424033
...
@@ -686,12 +686,15 @@ class Conv2DGradMaker : public framework::SingleGradOpMaker<T> {
...
@@ -686,12 +686,15 @@ class Conv2DGradMaker : public framework::SingleGradOpMaker<T> {
op
->
SetType
(
this
->
ForwardOpType
()
+
"_grad"
);
op
->
SetType
(
this
->
ForwardOpType
()
+
"_grad"
);
op
->
SetInput
(
"Input"
,
this
->
Input
(
"Input"
));
op
->
SetInput
(
"Input"
,
this
->
Input
(
"Input"
));
op
->
SetInput
(
"Filter"
,
this
->
Input
(
"Filter"
));
op
->
SetInput
(
"Filter"
,
this
->
Input
(
"Filter"
));
op
->
SetInput
(
"Bias"
,
this
->
Input
(
"Bias"
));
op
->
SetInput
(
framework
::
GradVarName
(
"Output"
),
this
->
OutputGrad
(
"Output"
));
op
->
SetInput
(
framework
::
GradVarName
(
"Output"
),
this
->
OutputGrad
(
"Output"
));
op
->
SetOutput
(
framework
::
GradVarName
(
"Input"
),
this
->
InputGrad
(
"Input"
));
op
->
SetOutput
(
framework
::
GradVarName
(
"Input"
),
this
->
InputGrad
(
"Input"
));
op
->
SetOutput
(
framework
::
GradVarName
(
"Filter"
),
this
->
InputGrad
(
"Filter"
));
op
->
SetOutput
(
framework
::
GradVarName
(
"Filter"
),
this
->
InputGrad
(
"Filter"
));
op
->
SetOutput
(
framework
::
GradVarName
(
"Bias"
),
this
->
InputGrad
(
"Bias"
));
if
(
this
->
HasInput
(
"Bias"
))
{
op
->
SetInput
(
"Bias"
,
this
->
Input
(
"Bias"
));
op
->
SetOutput
(
framework
::
GradVarName
(
"Bias"
),
this
->
InputGrad
(
"Bias"
));
}
op
->
SetAttrMap
(
this
->
Attrs
());
op
->
SetAttrMap
(
this
->
Attrs
());
}
}
};
};
...
...
paddle/fluid/operators/lstm_op.cc
浏览文件 @
83424033
...
@@ -186,9 +186,7 @@ class LSTMOpMaker : public framework::OpProtoAndCheckerMaker {
...
@@ -186,9 +186,7 @@ class LSTMOpMaker : public framework::OpProtoAndCheckerMaker {
"(bool, default: False) "
"(bool, default: False) "
"whether to compute reversed LSTM."
)
"whether to compute reversed LSTM."
)
.
SetDefault
(
false
);
.
SetDefault
(
false
);
AddAttr
<
bool
>
(
"is_test"
,
"True if in test phase."
)
AddAttr
<
bool
>
(
"is_test"
,
"True if in test phase."
).
SetDefault
(
false
);
.
SetDefault
(
false
)
.
AsExtra
();
AddAttr
<
std
::
string
>
(
AddAttr
<
std
::
string
>
(
"gate_activation"
,
"gate_activation"
,
"(string, default: sigmoid)"
"(string, default: sigmoid)"
...
...
paddle/fluid/operators/transpose_op.cc
浏览文件 @
83424033
...
@@ -223,7 +223,7 @@ class Transpose2Op : public TransposeOp {
...
@@ -223,7 +223,7 @@ class Transpose2Op : public TransposeOp {
void
InferShape
(
framework
::
InferShapeContext
*
ctx
)
const
override
{
void
InferShape
(
framework
::
InferShapeContext
*
ctx
)
const
override
{
TransposeOp
::
InferShape
(
ctx
);
TransposeOp
::
InferShape
(
ctx
);
OP_INOUT_CHECK
(
ctx
->
HasOutput
(
"XShape"
),
"Output"
,
"XShape"
,
"Transpose2"
)
;
if
(
!
ctx
->
HasOutput
(
"XShape"
))
return
;
const
auto
&
in_dims
=
ctx
->
GetInputDim
(
"X"
);
const
auto
&
in_dims
=
ctx
->
GetInputDim
(
"X"
);
std
::
vector
<
int64_t
>
x_shape_dim
(
in_dims
.
size
()
+
1
);
std
::
vector
<
int64_t
>
x_shape_dim
(
in_dims
.
size
()
+
1
);
x_shape_dim
[
0
]
=
0
;
x_shape_dim
[
0
]
=
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录