Describe the bug
AptaTransPipeline.recommend() uses a set to collect unique candidates, but each candidate tuple contains a PyTorch tensor (the score), which hashes by object identity rather than value. This means two identical sequences with different tensor objects are treated as distinct entries, and the set never actually deduplicates.
To Reproduce
>>> t1 = torch.tensor(0.5); t2 = torch.tensor(0.5)
>>> {("A", t1), ("A", t2)} # set size is 2, not 1
Expected behavior
As a result, recommend() may return duplicate sequences to the user.
Describe the bug
AptaTransPipeline.recommend()uses a set to collect unique candidates, but each candidate tuple contains a PyTorch tensor (the score), which hashes by object identity rather than value. This means two identical sequences with different tensor objects are treated as distinct entries, and the set never actually deduplicates.To Reproduce
Expected behavior
As a result, recommend() may return duplicate sequences to the user.