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

BUG: Return correctly shaped inverse indices in array_api set functions #20819

Merged
merged 2 commits into from Jan 13, 2022

Conversation

charris
Copy link
Member

@charris charris commented Jan 13, 2022

Backport of #20791.

As inverse indices from np.unique() are flattened when axis=None (the default), the related array_api set functions (xp.unique_inverse/xp.unique_all) don't return shape-sharing indices as the Array API specifies. This PR fixes this by internally reshaping the inverse indices.

Tested in array-api-tests , specifically https://github.com/data-apis/array-api-tests/blob/master/array_api_tests/test_set_functions.py. Note these tests will fail due to unrelated NaN-uniqueness issues.

Related #20638

@charris charris added this to the 1.22.1 release milestone Jan 13, 2022
@charris charris changed the base branch from main to maintenance/1.22.x January 13, 2022 19:01
@charris charris closed this Jan 13, 2022
@charris charris reopened this Jan 13, 2022
@charris charris merged commit 914b11f into numpy:maintenance/1.22.x Jan 13, 2022
@charris charris deleted the backport-20791 branch January 13, 2022 21:15
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