FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

BUG: Return correctly shaped inverse indices in array_api set functions by charris · Pull Request #20819 · numpy/numpy · GitHub

/ numpy Public

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

Merged
charris merged 2 commits into
numpy:maintenance/1.22.xfrom
charris:backport-20791
Jan 13, 2022
Merged

charris merged 2 commits into
numpy:maintenance/1.22.xfrom
charris:backport-20791

Conversation

charris commented Jan 13, 2022

Copy link
Copy Markdown
Member

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 added this to the 1.22.1 release milestone Jan 13, 2022
charris changed the base branch from main to maintenance/1.22.x January 13, 2022 19:01
charris closed this Jan 13, 2022
charris reopened this Jan 13, 2022
charris merged commit 914b11f into numpy:maintenance/1.22.x Jan 13, 2022
charris deleted the backport-20791 branch January 13, 2022 21:15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

2 participants


Back | FazBrowse Home | New Git URL