Skip to content

isclose gives false positives for large integers. #61412

@pmeier

Description

@pmeier

🐛 Bug

isclose gives false positives for large integers.

To Reproduce

>>> a = torch.tensor(140499600015872)
>>> b = torch.tensor(140499600015360)
>>> a == b
tensor(False)
>>> abs(a - b) <= 0
tensor(False)
>>> torch.isclose(a, b, atol=0, rtol=0)
tensor(True)

Expected behavior

a and b should not be considered close.

cc @ezyang @gchanan @zou3519 @bdhirsh @jbschlosser @anjali411

Metadata

Metadata

Assignees

No one assigned

    Labels

    module: testingIssues related to the torch.testing module (not tests)triagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions