Skip to content

[BUG] recommend() does not deduplicate candidates by sequence content #324

Description

@direkkakkar319-ops

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions