Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

[Numpy] more support for boolean indexing/assign and change on implementation #17672

Merged
merged 1 commit into from
Mar 3, 2020

Conversation

Alicia1529
Copy link
Contributor

Description

  1. implement boolean indexing through advanced indexing by following the below method

In general if an index includes a Boolean array, the result will be identical to inserting obj.nonzero() into the same position and using the integer array indexing mechanism described above. x[ind_1, boolean_array, ind_2] is equivalent to x[(ind_1,) + boolean_array.nonzero() + (ind_2,)].

  1. support boolean indexing/assign mixed with other ndarray

  2. support boolean assign without restriction on position (previously only support at most one boolean array at the end of the index array)

  3. support True/ array(True), False/array(False) as part of the indices

@Alicia1529 Alicia1529 requested a review from szha as a code owner February 24, 2020 12:53
@haojin2 haojin2 added the Numpy label Feb 25, 2020
@haojin2 haojin2 self-assigned this Feb 25, 2020
@Alicia1529 Alicia1529 changed the title [Numpy/Don't merge] more support for boolean indexing/assign and change on implementation [Numpy] more support for boolean indexing/assign and change on implementation Feb 26, 2020
@Alicia1529 Alicia1529 force-pushed the np_op_fix_bool_index branch 2 times, most recently from 9e53452 to 2c2d6a8 Compare February 26, 2020 08:40
Copy link
Contributor

@haojin2 haojin2 left a comment

Choose a reason for hiding this comment

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

LGTM

@Alicia1529 Alicia1529 force-pushed the np_op_fix_bool_index branch from 2c2d6a8 to bcb72ce Compare March 2, 2020 05:13
@haojin2 haojin2 merged commit 4e2305f into apache:master Mar 3, 2020
MoisesHer pushed a commit to MoisesHer/incubator-mxnet that referenced this pull request Apr 10, 2020
@ciyongch
Copy link
Contributor

@Alicia1529 , can you help to back port this PR to v1.7.x and v1.x branches as well, which will be included in the upcoming 1.7.0 release? As the issue is existing in these two branches so far. Thanks!

@Alicia1529
Copy link
Contributor Author

@Alicia1529 , can you help to back port this PR to v1.7.x and v1.x branches as well, which will be included in the upcoming 1.7.0 release? As the issue is existing in these two branches so far. Thanks!

Hi, sorry for my late reply. I will do it within this weekend.

@ciyongch
Copy link
Contributor

Thanks @Alicia1529 , please also tag me when the new PRs are created.

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

Successfully merging this pull request may close these issues.

3 participants