Skip to content

Conversation

@asmeurer
Copy link
Member

@asmeurer asmeurer commented Nov 5, 2024

No description provided.

@asmeurer asmeurer requested a review from Copilot November 5, 2024 21:25
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 5 out of 10 changed files in this pull request and generated 1 suggestion.

Files not reviewed (5)
  • array_api_strict/_typing.py: Evaluated as low risk
  • array_api_strict/init.py: Evaluated as low risk
  • array_api_strict/tests/test_array_object.py: Evaluated as low risk
  • array_api_strict/tests/test_elementwise_functions.py: Evaluated as low risk
  • array_api_strict/_elementwise_functions.py: Evaluated as low risk

return Array._new(np.take(x._array, indices._array, axis=axis), device=x.device)

@requires_api_version('2024.12')
def take_along_axis(x: Array, indices: Array, /, *, axis: int = -1) -> Array:
Copy link

Copilot AI Nov 5, 2024

Choose a reason for hiding this comment

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

The function take_along_axis should check that indices.dtype is in _integer_dtypes to ensure only integer indices are allowed.

Copilot uses AI. Check for mistakes.
@asmeurer
Copy link
Member Author

Going to merge and release this. This is all hidden behind a flag and warning, so even though this is still fairly untested, I think it's OK let people start playing with it.

I believe I have included every change to the draft standard since 2023.12. However, there are still some changes that are planned for 2024.12, but which aren't merged in the standard yet and which I haven't implemented here yet. The main one of interest is scalar support for array functions like where (see also #78). My plan is to implement this once there is an implementation in the standard.

@asmeurer asmeurer merged commit 838f7f4 into data-apis:main Nov 11, 2024
21 checks passed
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.

1 participant