Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
6885d156
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看板
未验证
提交
6885d156
编写于
5月 13, 2020
作者:
G
gongweibao
提交者:
GitHub
5月 13, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix errorenhancement test=release/1.8 (#24471)
上级
fc43909e
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
56 addition
and
36 deletion
+56
-36
paddle/fluid/operators/distributed_ops/prefetch_op.cc
paddle/fluid/operators/distributed_ops/prefetch_op.cc
+7
-1
paddle/fluid/operators/optimizers/proximal_adagrad_op.cc
paddle/fluid/operators/optimizers/proximal_adagrad_op.cc
+32
-24
paddle/fluid/operators/optimizers/proximal_gd_op.cc
paddle/fluid/operators/optimizers/proximal_gd_op.cc
+17
-11
未找到文件。
paddle/fluid/operators/distributed_ops/prefetch_op.cc
浏览文件 @
6885d156
...
@@ -57,7 +57,13 @@ class PrefetchOp : public framework::OperatorBase {
...
@@ -57,7 +57,13 @@ class PrefetchOp : public framework::OperatorBase {
}
}
}
}
for
(
size_t
i
=
0
;
i
<
rets
.
size
();
i
++
)
{
for
(
size_t
i
=
0
;
i
<
rets
.
size
();
i
++
)
{
PADDLE_ENFORCE
(
rets
[
i
]
->
Wait
(),
"internal error in RPCClient"
);
PADDLE_ENFORCE_EQ
(
rets
[
i
]
->
Wait
(),
true
,
platform
::
errors
::
Fatal
(
"It's a fatal error of RPCClient that RPCClient can't "
"get the wait result. It may happen when trainers or "
"parameter servers exit un normally or the network "
"issue!"
));
}
}
}
}
};
};
...
...
paddle/fluid/operators/optimizers/proximal_adagrad_op.cc
浏览文件 @
6885d156
...
@@ -24,34 +24,42 @@ class ProximalAdagradOp : public framework::OperatorWithKernel {
...
@@ -24,34 +24,42 @@ class ProximalAdagradOp : public framework::OperatorWithKernel {
protected:
protected:
void
InferShape
(
framework
::
InferShapeContext
*
ctx
)
const
override
{
void
InferShape
(
framework
::
InferShapeContext
*
ctx
)
const
override
{
PADDLE_ENFORCE
(
ctx
->
HasInput
(
"Param"
),
OP_INOUT_CHECK
(
ctx
->
HasInput
(
"Param"
),
"Input"
,
"Param"
,
"Input(Param) of ProximalAdagradOp should not be null."
);
"ProximalAdagradOp"
);
PADDLE_ENFORCE
(
ctx
->
HasInput
(
"Moment"
),
OP_INOUT_CHECK
(
ctx
->
HasInput
(
"Moment"
),
"Input"
,
"Moment"
,
"Input(Moment) of ProximalAdagradOp should not be null."
);
"ProximalAdagradOp"
);
PADDLE_ENFORCE
(
ctx
->
HasInput
(
"Grad"
),
OP_INOUT_CHECK
(
ctx
->
HasInput
(
"Grad"
),
"Input"
,
"Grad"
,
"ProximalAdagradOp"
);
"Input(Grad) of ProximalAdagradOp should not be null."
);
OP_INOUT_CHECK
(
ctx
->
HasInput
(
"LearningRate"
),
"Input"
,
"LearningRate"
,
PADDLE_ENFORCE
(
"ProximalAdagradOp"
);
ctx
->
HasInput
(
"LearningRate"
),
"Input(LearningRate) of ProximalAdagradOp should not be null."
);
OP_INOUT_CHECK
(
ctx
->
HasOutput
(
"ParamOut"
),
"Output"
,
"ParamOut"
,
"ProximalAdagradOp"
);
PADDLE_ENFORCE
(
ctx
->
HasOutput
(
"ParamOut"
),
OP_INOUT_CHECK
(
ctx
->
HasOutput
(
"MomentOut"
),
"Output"
,
"MomentOut"
,
"Output(ParamOut) of ProximalAdagradOp should not be null."
);
"ProximalAdagradOp"
);
PADDLE_ENFORCE
(
ctx
->
HasOutput
(
"MomentOut"
),
"Output(MomentOut) of ProximalAdagradOp should not be null."
);
auto
param_dim
=
ctx
->
GetInputDim
(
"Param"
);
auto
param_dim
=
ctx
->
GetInputDim
(
"Param"
);
PADDLE_ENFORCE_EQ
(
PADDLE_ENFORCE_EQ
(
param_dim
,
ctx
->
GetInputDim
(
"Grad"
),
param_dim
,
ctx
->
GetInputDim
(
"Grad"
),
platform
::
errors
::
InvalidArgument
(
"Param and Grad of ProximalAdagrad Op must have same dimension."
);
"The shape of Intput(Param) should be equal to the "
"Input(Grad) of ProximalAdagrad Op. But received "
PADDLE_ENFORCE_EQ
(
"Input(Param).dimensions=[%s], "
param_dim
,
ctx
->
GetInputDim
(
"Moment"
),
"Input(Grad).dimensions=[%s]"
,
"Param and Moment of ProximalAdagrad Op must have same dimension."
);
param_dim
,
ctx
->
GetInputDim
(
"Grad"
)));
PADDLE_ENFORCE_EQ
(
param_dim
,
ctx
->
GetInputDim
(
"Moment"
),
platform
::
errors
::
InvalidArgument
(
"The shape of Intput(Param) should be equal to the "
"Input(Moment) of ProximalAdagrad Op. But received "
"Input(Param).dimensions=[%s], "
"Input(Moment).dimensions=[%s]"
,
param_dim
,
ctx
->
GetInputDim
(
"Moment"
)));
auto
lr_dim
=
ctx
->
GetInputDim
(
"LearningRate"
);
auto
lr_dim
=
ctx
->
GetInputDim
(
"LearningRate"
);
PADDLE_ENFORCE_EQ
(
framework
::
product
(
lr_dim
),
1
,
PADDLE_ENFORCE_EQ
(
"Learning Rate should be a scalar."
);
framework
::
product
(
lr_dim
),
1
,
platform
::
errors
::
InvalidArgument
(
"Learning Rate should be a scalar. But received dimension[%s]"
,
lr_dim
));
ctx
->
SetOutputDim
(
"ParamOut"
,
param_dim
);
ctx
->
SetOutputDim
(
"ParamOut"
,
param_dim
);
ctx
->
SetOutputDim
(
"MomentOut"
,
param_dim
);
ctx
->
SetOutputDim
(
"MomentOut"
,
param_dim
);
...
...
paddle/fluid/operators/optimizers/proximal_gd_op.cc
浏览文件 @
6885d156
...
@@ -24,23 +24,29 @@ class ProximalGDOp : public framework::OperatorWithKernel {
...
@@ -24,23 +24,29 @@ class ProximalGDOp : public framework::OperatorWithKernel {
protected:
protected:
void
InferShape
(
framework
::
InferShapeContext
*
ctx
)
const
override
{
void
InferShape
(
framework
::
InferShapeContext
*
ctx
)
const
override
{
PADDLE_ENFORCE
(
ctx
->
HasInput
(
"Param"
),
OP_INOUT_CHECK
(
ctx
->
HasInput
(
"Param"
),
"Input"
,
"Param"
,
"ProximalGDOp"
);
"Input(Param) of ProximalGDOp should not be null."
);
OP_INOUT_CHECK
(
ctx
->
HasInput
(
"Grad"
),
"Input"
,
"Grad"
,
"ProximalGDOp"
);
PADDLE_ENFORCE
(
ctx
->
HasInput
(
"Grad"
),
OP_INOUT_CHECK
(
ctx
->
HasInput
(
"LearningRate"
),
"Input"
,
"LearningRate"
,
"Input(Grad) of ProximalGDOp should not be null."
);
"ProximalGDOp"
);
PADDLE_ENFORCE
(
ctx
->
HasInput
(
"LearningRate"
),
"Input(LearningRate) of ProximalGDOp should not be null."
);
PADDLE_ENFORCE
(
ctx
->
HasOutput
(
"ParamOut"
)
,
OP_INOUT_CHECK
(
ctx
->
HasOutput
(
"ParamOut"
),
"Output"
,
"Paramout"
,
"
Output(ParamOut) of ProximalGDOp should not be null.
"
);
"
ProximalGDOp
"
);
auto
param_dim
=
ctx
->
GetInputDim
(
"Param"
);
auto
param_dim
=
ctx
->
GetInputDim
(
"Param"
);
PADDLE_ENFORCE_EQ
(
param_dim
,
ctx
->
GetInputDim
(
"Grad"
),
PADDLE_ENFORCE_EQ
(
param_dim
,
ctx
->
GetInputDim
(
"Grad"
),
"Two input of ProximalGD Op's dimension must be same."
);
platform
::
errors
::
InvalidArgument
(
"The shape of Intput(Param) should be equal to the "
"Input(Grad) of ProximalGD Op. But received "
"Input(Param).dimensions=[%s], "
"Input(Grad).dimensions=[%s]"
,
param_dim
,
ctx
->
GetInputDim
(
"Grad"
)));
auto
lr_dim
=
ctx
->
GetInputDim
(
"LearningRate"
);
auto
lr_dim
=
ctx
->
GetInputDim
(
"LearningRate"
);
PADDLE_ENFORCE_EQ
(
framework
::
product
(
lr_dim
),
1
,
PADDLE_ENFORCE_EQ
(
"Learning Rate should be a scalar."
);
framework
::
product
(
lr_dim
),
1
,
platform
::
errors
::
InvalidArgument
(
"Learning Rate should be a scalar. But received dimmensions:[%s]"
,
lr_dim
));
ctx
->
SetOutputDim
(
"ParamOut"
,
param_dim
);
ctx
->
SetOutputDim
(
"ParamOut"
,
param_dim
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录