Skip to content

array_api_compat.torch.round raises NotImplementedError for complex input #407

Closed

Description

@mdhaber

The standard defines round for all numeric input, but:

from array_api_compat import torch as xp
xp.round(xp.asarray(1.5 + 1.5j))
# Traceback (most recent call last):
#   File "E:\miniforge3\envs\scipy-dev\Lib\site-packages\IPython\core\interactiveshell.py", line 3747, in run_code
#     exec(code_obj, self.user_global_ns, self.user_ns)
#     ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#   File "<ipython-input-4-b58171f4cea1>", line 1, in <module>
#     xp.round(xp.asarray(1.5 + 1.5j))
#     ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
# NotImplementedError: "round_vml_cpu" not implemented for 'ComplexFloat'

Activity

  1. ev-br commented on Mar 16, 2026

    @ev-br
    Member

    Indeed the test is skipped: https://github.com/data-apis/array-api-compat/blob/main/torch-xfails.txt#L132-L133
    Is there an upstream issue for round?

  2. mdhaber commented on Mar 16, 2026

    @mdhaber
    ContributorAuthor
  3. ev-br commented on Mar 17, 2026

    @ev-br
    Member

    Thanks. Fix in #408, could you review / double-check that it fixes your issue Matt?

  4. added this to the 1.15 milestone on Apr 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions