Skip to content

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

@mdhaber

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'

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

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions