Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleRec
提交
4d514d46
P
PaddleRec
项目概览
PaddlePaddle
/
PaddleRec
通知
68
Star
12
Fork
5
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
27
列表
看板
标记
里程碑
合并请求
10
Wiki
1
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleRec
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
27
Issue
27
列表
看板
标记
里程碑
合并请求
10
合并请求
10
Pages
分析
分析
仓库分析
DevOps
Wiki
1
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
4d514d46
编写于
6月 03, 2020
作者:
W
wuzhihua
提交者:
GitHub
6月 03, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' into add_FM
上级
3f35e322
74625fc4
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
13 addition
and
2 deletion
+13
-2
core/trainers/single_trainer.py
core/trainers/single_trainer.py
+13
-2
未找到文件。
core/trainers/single_trainer.py
浏览文件 @
4d514d46
...
...
@@ -248,8 +248,19 @@ class SingleTrainer(TranspileTrainer):
_exe_strategy
=
fluid
.
ExecutionStrategy
()
# 0: kCoeffNumDevice; 1: One; 2: Customized
_build_strategy
.
gradient_scale_strategy
=
model_dict
.
get
(
"gradient_scale_strategy"
,
0
)
_gradient_scale_strategy
=
model_dict
.
get
(
"gradient_scale_strategy"
,
0
)
if
_gradient_scale_strategy
==
0
:
gradient_scale_strategy
=
fluid
.
BuildStrategy
.
GradientScaleStrategy
.
CoeffNumDevice
elif
_gradient_scale_strategy
==
1
:
gradient_scale_strategy
=
fluid
.
BuildStrategy
.
GradientScaleStrategy
.
One
elif
_gradient_scale_strategy
==
2
:
gradient_scale_strategy
=
fluid
.
BuildStrategy
.
GradientScaleStrategy
.
Customized
else
:
raise
ValueError
(
"Unsurpported config. gradient_scale_strategy must be one of [0, 1, 2]."
)
_build_strategy
.
gradient_scale_strategy
=
gradient_scale_strategy
if
"thread_num"
in
model_dict
and
model_dict
[
"thread_num"
]
>
1
:
_build_strategy
.
reduce_strategy
=
fluid
.
BuildStrategy
.
ReduceStrategy
.
Reduce
_exe_strategy
.
num_threads
=
model_dict
[
"thread_num"
]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录