Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
7ffd50b9
P
Paddle
项目概览
PaddlePaddle
/
Paddle
1 年多 前同步成功
通知
2302
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看板
提交
7ffd50b9
编写于
2月 23, 2018
作者:
Y
Yu Yang
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'feature/add_fwd_block_id' of github.com:reyoung/Paddle into feature/add_fwd_block_id
上级
aaf818f5
bf92706c
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
10 addition
and
10 deletion
+10
-10
python/paddle/v2/fluid/memory_optimization_transpiler.py
python/paddle/v2/fluid/memory_optimization_transpiler.py
+10
-10
未找到文件。
python/paddle/v2/fluid/memory_optimization_transpiler.py
浏览文件 @
7ffd50b9
...
...
@@ -223,15 +223,15 @@ def get_cfgs(input_program):
# Find while/while_grad block pair
for
grad_id
in
while_grad_sub_block_ids
:
parent_id
=
pdesc
.
block
(
grad_id
).
parent
if
parent
_id
in
while_sub_block_ids
:
while_block_id_pair
.
append
((
parent
_id
,
grad_id
))
while_sub_block_ids
.
remove
(
parent
_id
)
forward_id
=
pdesc
.
block
(
grad_id
).
get_forward_block_idx
()
if
forward
_id
in
while_sub_block_ids
:
while_block_id_pair
.
append
((
forward
_id
,
grad_id
))
while_sub_block_ids
.
remove
(
forward
_id
)
# Get while/while_grad block ops
for
parent
_id
,
grad_id
in
while_block_id_pair
:
for
forward
_id
,
grad_id
in
while_block_id_pair
:
while_block_ops
=
[]
while_block
=
pdesc
.
block
(
parent
_id
)
while_block
=
pdesc
.
block
(
forward
_id
)
while_block_op_size
=
while_block
.
op_size
()
for
i
in
range
(
while_block_op_size
):
while_block_ops
.
append
(
while_block
.
op
(
i
))
...
...
@@ -242,21 +242,21 @@ def get_cfgs(input_program):
while_block_ops
.
append
(
while_grad_block
.
op
(
i
))
while_op_output
=
set
()
while_op_output
.
update
(
while_op_dict
[
parent
_id
].
output_arg_names
())
while_op_output
.
update
(
while_op_dict
[
forward
_id
].
output_arg_names
())
while_op_output
.
update
(
while_op_dict
[
grad_id
].
output_arg_names
())
ops_list
.
append
((
while_block_ops
,
while_block_op_size
,
while_op_output
))
# Process rest while block ops
for
parent
_id
in
while_sub_block_ids
:
for
forward
_id
in
while_sub_block_ids
:
while_block_ops
=
[]
while_block
=
pdesc
.
block
(
parent
_id
)
while_block
=
pdesc
.
block
(
forward
_id
)
while_block_op_size
=
while_block
.
op_size
()
for
i
in
range
(
while_block_op_size
):
while_block_ops
.
append
(
while_block
.
op
(
i
))
while_op_output
=
set
()
while_op_output
.
update
(
while_op_dict
[
parent
_id
].
output_arg_names
())
while_op_output
.
update
(
while_op_dict
[
forward
_id
].
output_arg_names
())
ops_list
.
append
((
while_block_ops
,
while_block_op_size
,
while_op_output
))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录