Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Crayon鑫
Paddle
提交
a16a8727
P
Paddle
项目概览
Crayon鑫
/
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看板
提交
a16a8727
编写于
4月 04, 2018
作者:
T
typhoonzero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
上级
e0b396e7
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
16 addition
and
19 deletion
+16
-19
python/paddle/fluid/distribute_transpiler.py
python/paddle/fluid/distribute_transpiler.py
+2
-12
python/paddle/fluid/framework.py
python/paddle/fluid/framework.py
+14
-7
未找到文件。
python/paddle/fluid/distribute_transpiler.py
浏览文件 @
a16a8727
...
@@ -408,11 +408,7 @@ class DistributeTranspiler:
...
@@ -408,11 +408,7 @@ class DistributeTranspiler:
pserver_vars
=
pserver_program
.
global_block
().
vars
pserver_vars
=
pserver_program
.
global_block
().
vars
created_var_map
=
dict
()
created_var_map
=
dict
()
for
_
,
var
in
pserver_vars
.
iteritems
():
for
_
,
var
in
pserver_vars
.
iteritems
():
if
var
.
type
==
core
.
VarDesc
.
VarType
.
STEP_SCOPES
:
tmpvar
=
s_prog
.
global_block
().
clone_variable
(
var
)
tmpvar
=
s_prog
.
global_block
().
create_var
(
name
=
var
.
name
,
persistable
=
var
.
persistable
,
type
=
var
.
type
)
else
:
tmpvar
=
s_prog
.
global_block
().
clone_variable
(
var
)
created_var_map
[
var
.
name
]
=
tmpvar
created_var_map
[
var
.
name
]
=
tmpvar
# 2. rename op outputs
# 2. rename op outputs
...
@@ -708,13 +704,7 @@ class DistributeTranspiler:
...
@@ -708,13 +704,7 @@ class DistributeTranspiler:
varlist
=
[
varlist
]
varlist
=
[
varlist
]
for
var
in
varlist
:
for
var
in
varlist
:
if
var
.
type
==
core
.
VarDesc
.
VarType
.
STEP_SCOPES
:
program
.
global_block
().
clone_variable
(
var
)
program
.
global_block
().
create_var
(
name
=
var
.
name
,
persistable
=
var
.
persistable
,
type
=
var
.
type
)
else
:
program
.
global_block
().
clone_variable
(
var
)
optimize_block
.
append_op
(
optimize_block
.
append_op
(
type
=
opt_op
.
type
,
type
=
opt_op
.
type
,
...
...
python/paddle/fluid/framework.py
浏览文件 @
a16a8727
...
@@ -946,13 +946,20 @@ class Block(object):
...
@@ -946,13 +946,20 @@ class Block(object):
The new variable cloned from 'var' in current block.
The new variable cloned from 'var' in current block.
"""
"""
assert
isinstance
(
var
,
Variable
)
assert
isinstance
(
var
,
Variable
)
return
self
.
create_var
(
ret_var
=
None
name
=
var
.
name
,
# make STEP_SCOPES var can be safely cloned.
shape
=
var
.
shape
,
if
var
.
type
==
core
.
VarDesc
.
VarType
.
STEP_SCOPES
:
dtype
=
var
.
dtype
,
ret_var
=
self
.
create_var
(
type
=
var
.
type
,
name
=
var
.
name
,
persistable
=
var
.
persistable
,
type
=
var
.
type
)
lod_level
=
var
.
lod_level
,
else
:
persistable
=
True
)
ret_var
=
self
.
create_var
(
name
=
var
.
name
,
shape
=
var
.
shape
,
dtype
=
var
.
dtype
,
type
=
var
.
type
,
lod_level
=
var
.
lod_level
,
persistable
=
True
)
return
ret_var
class
Program
(
object
):
class
Program
(
object
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录