Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OPTHREE
Paddle
提交
8b97a3a4
P
Paddle
项目概览
OPTHREE
/
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
8b97a3a4
编写于
1月 30, 2019
作者:
D
dzhwinter
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rerun ci. test=develop
上级
a52be7c0
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
9 addition
and
8 deletion
+9
-8
python/paddle/fluid/framework.py
python/paddle/fluid/framework.py
+2
-2
python/paddle/fluid/io.py
python/paddle/fluid/io.py
+1
-1
python/paddle/fluid/parallel_executor.py
python/paddle/fluid/parallel_executor.py
+1
-0
python/paddle/fluid/tests/unittests/test_inference_model_io.py
...n/paddle/fluid/tests/unittests/test_inference_model_io.py
+3
-3
python/paddle/fluid/transpiler/memory_optimization_transpiler.py
...paddle/fluid/transpiler/memory_optimization_transpiler.py
+2
-2
未找到文件。
python/paddle/fluid/framework.py
浏览文件 @
8b97a3a4
...
...
@@ -1735,7 +1735,7 @@ class Program(object):
return
self
.
__is_optimized
@
_is_optimized
.
setter
def
set_
_is_optimized
(
self
,
target
):
def
_is_optimized
(
self
,
target
):
self
.
__is_optimized
=
target
@
property
...
...
@@ -1756,7 +1756,7 @@ class Program(object):
return
self
.
_current_role
@
op_role
.
setter
def
set_
op_role
(
self
,
role
):
def
op_role
(
self
,
role
):
self
.
_current_role
=
role
@
property
...
...
python/paddle/fluid/io.py
浏览文件 @
8b97a3a4
...
...
@@ -931,7 +931,7 @@ def save_inference_model(dirname,
if
main_program
is
None
:
main_program
=
default_main_program
()
if
main_program
.
is_optimized
:
if
main_program
.
_
is_optimized
:
warnings
.
warn
(
"save_inference_model must put before you call memory_optimize.
\
the memory_optimize will modify the original program,
\
...
...
python/paddle/fluid/parallel_executor.py
浏览文件 @
8b97a3a4
...
...
@@ -135,6 +135,7 @@ class ParallelExecutor(object):
# step3: init build_strategy
if
build_strategy
is
None
:
build_strategy
=
BuildStrategy
()
build_strategy
.
enable_inplace
=
False
if
main
.
_is_optimized
else
True
build_strategy
.
num_trainers
=
num_trainers
build_strategy
.
trainer_id
=
trainer_id
# FIXME(zcd): is_distribution_ is a temporary field, because in pserver mode,
...
...
python/paddle/fluid/tests/unittests/test_inference_model_io.py
浏览文件 @
8b97a3a4
...
...
@@ -108,9 +108,9 @@ class TestSaveInferenceModel(unittest.TestCase):
exe
.
run
(
init_program
,
feed
=
{},
fetch_list
=
[])
memory_optimize
(
program
,
print_log
=
True
)
self
.
assert
Raises
(
RuntimeError
,
save_inference_model
(
MODEL_DIR
,
[
"x"
,
"y"
],
[
avg_cost
],
exe
,
program
)
)
self
.
assert
Equal
(
program
.
_is_optimized
,
True
)
# will print warning message
save_inference_model
(
MODEL_DIR
,
[
"x"
,
"y"
],
[
avg_cost
],
exe
,
program
)
if
__name__
==
'__main__'
:
...
...
python/paddle/fluid/transpiler/memory_optimization_transpiler.py
浏览文件 @
8b97a3a4
...
...
@@ -540,7 +540,7 @@ def memory_optimize(input_program,
if
skip_opt_set
is
not
None
:
skip_opt_set
=
set
(
map
(
to_name_str
,
skip_opt_set
))
cfgs
=
_get_cfgs
(
input_program
)
input_program
.
is_optimized
=
True
input_program
.
_
is_optimized
=
True
for
cfg
in
cfgs
:
cfg
.
memory_optimize
(
skip_opt_set
=
skip_opt_set
,
level
=
level
)
...
...
@@ -560,6 +560,6 @@ def release_memory(input_program, skip_opt_set=None):
None
"""
cfgs
=
_get_cfgs
(
input_program
)
input_program
.
is_optimized
=
True
input_program
.
_
is_optimized
=
True
for
cfg
in
cfgs
:
cfg
.
release_memory
(
skip_opt_set
=
skip_opt_set
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录