未验证 提交 f7fbef17 编写于 作者: W Wu Yi 提交者: GitHub

Merge pull request #10027 from typhoonzero/fix_transpiler_last_empty_block

Remove redundent pserver block
...@@ -420,13 +420,14 @@ class DistributeTranspiler: ...@@ -420,13 +420,14 @@ class DistributeTranspiler:
# append op to the current block # append op to the current block
per_opt_block = append_block per_opt_block = append_block
for _, opt_op in enumerate(opt_op_on_pserver): for idx, opt_op in enumerate(opt_op_on_pserver):
for _, op in enumerate(self.optimize_ops): for _, op in enumerate(self.optimize_ops):
# optimizer is connected to itself # optimizer is connected to itself
if ufind.is_connected(op, opt_op) and \ if ufind.is_connected(op, opt_op) and \
op not in global_ops: op not in global_ops:
__append_optimize_op__(op, per_opt_block) __append_optimize_op__(op, per_opt_block)
per_opt_block = pserver_program.create_block(append_block.idx) if idx == len(opt_op_on_pserver) - 1 and global_ops:
per_opt_block = pserver_program.create_block(append_block.idx)
# append global ops # append global ops
for glb_op in global_ops: for glb_op in global_ops:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册