当lookup_table的索引超过了矩阵的长度,cpu版会报一下错误:
InvalidArgumentError: indices[n,m] = x is not in [0, y)
其中x比y大。
在gpu版中,会自动帮你跳过这个数,自动补全为0;cpu版不会,会报这个上面错误。
具体见下面的讨论:
the embedding_lookup() returns zeros when the index exceed embedding matrix size?
当lookup_table的索引超过了矩阵的长度,cpu版会报一下错误:
InvalidArgumentError: indices[n,m] = x is not in [0, y)
其中x比y大。
在gpu版中,会自动帮你跳过这个数,自动补全为0;cpu版不会,会报这个上面错误。
具体见下面的讨论:
the embedding_lookup() returns zeros when the index exceed embedding matrix size?