Skip to content

conj, real, and imag not found in array_api_compat.torch #186

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
asmeurer opened this issue May 1, 2023 · 0 comments · Fixed by #184
Closed

conj, real, and imag not found in array_api_compat.torch #186

asmeurer opened this issue May 1, 2023 · 0 comments · Fixed by #184

Comments

@asmeurer
Copy link
Member

asmeurer commented May 1, 2023

Running the tests against array_api_compat.torch (with #184 and data-apis/array-api-compat#38) I get several errors like

FAILED array_api_tests/test_operators_and_elementwise_functions.py::test_conj - AttributeError: module 'array_api_tests._array_module' has no attribute 'conj'
FAILED array_api_tests/test_operators_and_elementwise_functions.py::test_imag - AttributeError: module 'array_api_tests._array_module' has no attribute 'imag'
FAILED array_api_tests/test_operators_and_elementwise_functions.py::test_real - AttributeError: module 'array_api_tests._array_module' has no attribute 'real'

Here's what the failure looks like

_______________________________________________________________________________ test_imag _______________________________________________________________________________

    @given(xps.arrays(dtype=xps.complex_dtypes(), shape=hh.shapes()))
>   def test_imag(x):

array_api_tests/test_operators_and_elementwise_functions.py:1092:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

x = tensor([], dtype=torch.complex64)

    @given(xps.arrays(dtype=xps.complex_dtypes(), shape=hh.shapes()))
    def test_imag(x):
>       out = xp.imag(x)
E       AttributeError: module 'array_api_tests._array_module' has no attribute 'imag'
E       Falsifying example: test_imag(
E           x=tensor([], dtype=torch.complex64),
E       )

array_api_tests/test_operators_and_elementwise_functions.py:1093: AttributeError

But these functions are in the namespace:

>>> import array_api_compat.torch
>>> array_api_compat.torch.conj
<built-in method conj of type object at 0x10f8b2be0>
>>> array_api_compat.torch.real
<built-in method real of type object at 0x10f8b2be0>
>>> array_api_compat.torch.imag
<built-in method imag of type object at 0x10f8b2be0>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant