Skip to content

2022.12 support #38

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

Merged
merged 13 commits into from
Jun 20, 2023
Merged

2022.12 support #38

merged 13 commits into from
Jun 20, 2023

Conversation

asmeurer
Copy link
Member

This is still WIP because we need some fixes to the test suite.

@rgommers
Copy link
Member

@asmeurer are you also adding fft extension support, in this PR or a separate one?

@asmeurer
Copy link
Member Author

The test suite doesn't check anything yet, but assuming torch.fft and so on already match the spec then there's nothing to do.

@asmeurer
Copy link
Member Author

asmeurer commented May 1, 2023

Thanks to work from @honno at data-apis/array-api-tests#184, I have some updates on pytorch complex numbers support:

The following torch functions do not support complex numbers:

  • expm1
  • round
  • sign
  • unique_*

round and sign should be easy to work around. expm1 and unique_* are harder to work around directly so I probably won't attempt that.

@rgommers
Copy link
Member

rgommers commented May 2, 2023

unique

unique_* are harder to work around directly so I probably won't attempt that.

That's probably caused by torch.unique sorting by default and having a keyword for it; sorting won't work with complex dtypes. Not too relevant for the standard, but a pain to get to work indeed in a wrapper. So I agree with your decisions here.

@asmeurer asmeurer marked this pull request as ready for review June 16, 2023 22:31
Copy link
Member

@honno honno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Regarding array_api_compat.torch.take(), IIRC index_put() wasn't quite adequate for "full" NumPy compat and I ended up using torch.Tensor.__get__() (Quansight-Labs/numpy_pytorch_interop#96), but it's not that surprising if it's fine for the Array API scope. I'm sure attempted-adoption in SciPy will be a brilliant way to battle-test array_api_compat.torch.take() in the end anywho, just note my test_take does have a few limitations...

https://github.com/data-apis/array-api-tests/blob/f82c7bc8627cc2c3a44fa3e425f53a253a609aa8/array_api_tests/test_indexing_functions.py#L21-L24

@asmeurer
Copy link
Member Author

We figured out @tupui's isdtype issue. It was related to a version of the function that he had implemented in scipy. It seems there aren't any issues with the version in the compat library. So we can go ahead and do a release here.

@asmeurer asmeurer enabled auto-merge June 20, 2023 18:11
@asmeurer asmeurer merged commit 34e9d0c into data-apis:main Jun 20, 2023
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 this pull request may close these issues.

3 participants