提交 e0b396e7 编写于 作者: T typhoonzero

update by comment

上级 39277e92
...@@ -412,12 +412,7 @@ class DistributeTranspiler: ...@@ -412,12 +412,7 @@ class DistributeTranspiler:
tmpvar = s_prog.global_block().create_var( tmpvar = s_prog.global_block().create_var(
name=var.name, persistable=var.persistable, type=var.type) name=var.name, persistable=var.persistable, type=var.type)
else: else:
tmpvar = s_prog.global_block().create_var( tmpvar = s_prog.global_block().clone_variable(var)
name=var.name,
persistable=var.persistable,
type=var.type,
dtype=var.dtype,
shape=var.shape)
created_var_map[var.name] = tmpvar created_var_map[var.name] = tmpvar
# 2. rename op outputs # 2. rename op outputs
...@@ -713,18 +708,13 @@ class DistributeTranspiler: ...@@ -713,18 +708,13 @@ class DistributeTranspiler:
varlist = [varlist] varlist = [varlist]
for var in varlist: for var in varlist:
print("##### deal var: ", var)
if var.type == core.VarDesc.VarType.STEP_SCOPES: if var.type == core.VarDesc.VarType.STEP_SCOPES:
program.global_block().create_var( program.global_block().create_var(
name=var.name, name=var.name,
persistable=var.persistable, persistable=var.persistable,
type=var.type) type=var.type)
else: else:
program.global_block().create_var( program.global_block().clone_variable(var)
name=var.name,
persistable=var.persistable,
dtype=var.dtype,
shape=var.shape)
optimize_block.append_op( optimize_block.append_op(
type=opt_op.type, type=opt_op.type,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册