提交 39277e92 编写于 作者: T typhoonzero

fix transpiler condition op in optimize

上级 95710456
...@@ -408,9 +408,14 @@ class DistributeTranspiler: ...@@ -408,9 +408,14 @@ 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().create_var(
name=var.name, persistable=var.persistable, type=var.type)
else:
tmpvar = s_prog.global_block().create_var( tmpvar = s_prog.global_block().create_var(
name=var.name, name=var.name,
persistable=var.persistable, persistable=var.persistable,
type=var.type,
dtype=var.dtype, dtype=var.dtype,
shape=var.shape) shape=var.shape)
created_var_map[var.name] = tmpvar created_var_map[var.name] = tmpvar
...@@ -708,6 +713,13 @@ class DistributeTranspiler: ...@@ -708,6 +713,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:
program.global_block().create_var(
name=var.name,
persistable=var.persistable,
type=var.type)
else:
program.global_block().create_var( program.global_block().create_var(
name=var.name, name=var.name,
persistable=var.persistable, persistable=var.persistable,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册