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

API: Add cross to numpy.linalg [Array API] #25145

Merged
merged 1 commit into from Dec 5, 2023

Conversation

mtsokol
Copy link
Member

@mtsokol mtsokol commented Nov 14, 2023

This PR contains next Array API compatibility change. It adds numpy.linalg.cross (almost the same as numpy.cross) with docs taken from Array API specification.

@ngoldbaum
Copy link
Member

This looks good to me. xref #13718 for a little context.

It also looks like we've already deprecated the 2D cross product behavior:

In [2]: np.cross([1, 2], [2, 1])
<ipython-input-2-eec728c54e9b>:1: DeprecationWarning: Arrays of 2-dimensional vectors are deprecated. Use arrays of 3-dimensional vectors instead. (deprecated in NumPy 2.0)
  np.cross([1, 2], [2, 1])
Out[2]: array(-3)

In it goes. Thanks @mtsokol!

@ngoldbaum ngoldbaum merged commit be4e25f into numpy:main Dec 5, 2023
61 checks passed
@mtsokol mtsokol deleted the array-api-cross branch December 5, 2023 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants