Skip to content
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

2023.12 support #249

Open
13 of 21 tasks
asmeurer opened this issue Mar 28, 2024 · 6 comments · Fixed by #255
Open
13 of 21 tasks

2023.12 support #249

asmeurer opened this issue Mar 28, 2024 · 6 comments · Fixed by #255
Assignees
Labels

Comments

@asmeurer
Copy link
Member

asmeurer commented Mar 28, 2024

We need a tracking issue for 2023.12 support in the test suite.

Here is the list of changes https://data-apis.org/array-api/latest/changelog.html#v2023-12

New Functions

  • __array_namespace_info__ (i.e., the inspection API)
  • clip
  • copysign
  • cumulative_sum
  • hypot
  • maximum
  • minimum
  • moveaxis
  • repeat
  • searchsorted
  • signbit
  • tile
  • unstack

API Changes

Other Changes
(not sure if these need tests)

  • Support for lazy functions in various APIs. Will probably need a real world lazy implementation to support this.
  • Order of signed zeros unspecified for max and min. Just need to make sure we aren't testing this.
  • Out of bounds unspecified for take.
  • tensordot should support negative axes (not sure if this is already tested)

I think that's everything but you might want to read through the changes too to check if I missed something.

@asmeurer
Copy link
Member Author

Note: clip is tricky, especially given the divergences between the standard and the NumPy implementation. We should be especially sure to that the test can catch possible issues with incorrect promotion behavior (clip should not promote but return the same dtype as x) so we can catch potential issues with integer overflow like described at numpy/numpy#24976

@asmeurer
Copy link
Member Author

Notes for copysign special cases: One can construct a nan with a negative sign bit using -float('nan'). To test the sign bit of a nan you'd either have to use signbit or use math.copysign.

@honno honno self-assigned this Apr 29, 2024
@asmeurer
Copy link
Member Author

I edited the above list to add a couple of things I missed.

@asmeurer
Copy link
Member Author

asmeurer commented May 6, 2024

Should this have been closed?

@honno honno reopened this May 7, 2024
@honno
Copy link
Member

honno commented May 7, 2024

Should this have been closed?

Good catch!

@asmeurer
Copy link
Member Author

asmeurer commented May 7, 2024

I noticed the searchsorted test is broken because it uses __array_namespace_info__, which isn't listed correctly in the array-api stubs (it's also broken because it uses float instead of int for the sorter array, but that's an easy fix). I tried fixing this in the submodule:

diff --git a/src/array_api_stubs/_2023_12/__init__.py b/src/array_api_stubs/_2023_12/__init__.py
index 8415f276..537ea8f8 100644
--- a/src/array_api_stubs/_2023_12/__init__.py
+++ b/src/array_api_stubs/_2023_12/__init__.py
@@ -16,7 +16,7 @@ from .statistical_functions import *
 from .utility_functions import *
 from . import linalg
 from . import fft
-from . import info
+from .info import __array_namespace_info__


 __array_api_version__: str = "YYYY.MM"

but the fix doesn't seem to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants