From 67050468e1c2801e0aa0c7896cd8e5ffb5046f8f Mon Sep 17 00:00:00 2001 From: Qiao Longfei Date: Thu, 8 Nov 2018 13:24:54 +0800 Subject: [PATCH] optimize code test=develop --- .../details/distribute_lookuptable_utils.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/python/paddle/fluid/transpiler/details/distribute_lookuptable_utils.py b/python/paddle/fluid/transpiler/details/distribute_lookuptable_utils.py index ce1e99340..52d9ce75f 100644 --- a/python/paddle/fluid/transpiler/details/distribute_lookuptable_utils.py +++ b/python/paddle/fluid/transpiler/details/distribute_lookuptable_utils.py @@ -16,11 +16,12 @@ LOOKUP_TABLE_TYPE = "lookup_table" def find_distributed_lookup_table(program): - # process lookup_table_op - # 1. check all lookup_table_op is distributed - # 2. check all lookup_table_op share the same table. - distributed_lookup_table_ops = [] - # support only one distributed_lookup_table now + """ + Find distribute lookup table in program. + We only support one distribute table now. + :param program: + :return: table_name or None + """ table_name = None for op in program.global_block().ops: @@ -31,7 +32,6 @@ def find_distributed_lookup_table(program): if table_name != op.input("W")[0]: raise RuntimeError("all distributed lookup_table_ops" " should have only one table") - distributed_lookup_table_ops.append(op) else: if table_name is not None: assert op.input("W")[0] != table_name -- GitLab