提交 67050468 编写于 作者: Q Qiao Longfei

optimize code

test=develop
上级 ffd5a832
...@@ -16,11 +16,12 @@ LOOKUP_TABLE_TYPE = "lookup_table" ...@@ -16,11 +16,12 @@ LOOKUP_TABLE_TYPE = "lookup_table"
def find_distributed_lookup_table(program): def find_distributed_lookup_table(program):
# process lookup_table_op """
# 1. check all lookup_table_op is distributed Find distribute lookup table in program.
# 2. check all lookup_table_op share the same table. We only support one distribute table now.
distributed_lookup_table_ops = [] :param program:
# support only one distributed_lookup_table now :return: table_name or None
"""
table_name = None table_name = None
for op in program.global_block().ops: for op in program.global_block().ops:
...@@ -31,7 +32,6 @@ def find_distributed_lookup_table(program): ...@@ -31,7 +32,6 @@ def find_distributed_lookup_table(program):
if table_name != op.input("W")[0]: if table_name != op.input("W")[0]:
raise RuntimeError("all distributed lookup_table_ops" raise RuntimeError("all distributed lookup_table_ops"
" should have only one table") " should have only one table")
distributed_lookup_table_ops.append(op)
else: else:
if table_name is not None: if table_name is not None:
assert op.input("W")[0] != table_name assert op.input("W")[0] != table_name
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册