未验证 提交 5970e8ac 编写于 作者: T Thunderbrook 提交者: GitHub

find lookup table in order (#20932)

test=develop
上级 98f1cebd
......@@ -130,13 +130,22 @@ class DistributedAdam(DistributedOptimizerImplBase):
find multi-sparse-table
"""
table_names = set()
cnt = 0
tmp_list = []
ret_list = []
for loss in losses:
for op in loss.block.program.global_block().ops:
if op.type == "lookup_table":
if op.attr('is_distributed') is True:
table_name = op.input("W")[0]
if table_name not in table_names:
table_names.add(table_name)
return list(table_names)
tmp_list.append([table_name, cnt])
cnt += 1
tmp_list.sort(key=lambda k: k[1])
for x in tmp_list:
ret_list.append(x[0])
return ret_list
def _minimize(self,
losses,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册