Skip to content

make torch.(ceil|floor|round|trunc) no-ops for integer inputs #70918

@pmeier

Description

@pmeier

The array API specification stipulates that torch.(ceil|floor|round|trunc) should be no-ops for integer inputs. We currently have no functionality implemented for these cases

>>> t = torch.tensor(0)
>>> torch.ceil(t)
RuntimeError: "ceil" "_vml_cpu" not implemented for 'Long'
>>> torch.floor(t)
RuntimeError: "floor" "_vml_cpu" not implemented for 'Long'
>>> torch.round(t)
RuntimeError: "round" "_vml_cpu" not implemented for 'Long'
>>> torch.trunc(t)
RuntimeError: "trunc" "_vml_cpu" not implemented for 'Long'

cc @mruberry @rgommers @pmeier @asmeurer @leofang @AnirudhDagar @asi1024 @emcastillo @kmaehashi

Metadata

Metadata

Assignees

No one assigned

    Labels

    module: python array apiIssues related to the Python Array APItriagedThis 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