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

Support broadcast assign for npi_boolean_mask_assign_tensor #17131

Merged
merged 2 commits into from
Feb 15, 2020

Conversation

haojin2
Copy link
Contributor

@haojin2 haojin2 commented Dec 20, 2019

Description

As title.
This is the backbone for supporting case like:

from mxnet import np, npx
npx.set_np()
a = np.zeros((3, 4))
mask = np.array([False, True, True])
a[mask, :] = np.ones((1, 4)) # the (1, 4) tensor is broadcasted onto the target shape of (2, 4)

Checklist

Essentials

Please feel free to remove inapplicable items for your PR.

  • The PR title starts with [MXNET-$JIRA_ID], where $JIRA_ID refers to the relevant JIRA issue created (except PRs with tiny changes)
  • Changes are complete (i.e. I finished coding on this PR)
  • All changes have test coverage:
  • Unit tests are added for small changes to verify correctness (e.g. adding a new operator)
  • Nightly tests are added for complicated/long-running ones (e.g. changing distributed kvstore)
  • Build tests will be added for build configuration changes (e.g. adding a new build option with NCCL)
  • Code is well-documented:
  • For user-facing API changes, API doc string has been updated.
  • For new C++ functions in header files, their functionalities and arguments are documented.
  • For new examples, README.md is added to explain the what the example does, the source of the dataset, expected performance on test set and reference to the original paper if applicable
  • Check the API doc at https://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
  • To the best of my knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change

Changes

  • Added support
  • Unit test

Comments

  • If this change is a backward incompatible change, why must this change be made.
  • Interesting edge cases to note here

@haojin2 haojin2 added the Numpy label Dec 20, 2019
@haojin2 haojin2 self-assigned this Dec 20, 2019
@haojin2 haojin2 force-pushed the np_boolean_mask_assign_broadcast branch from 3a68879 to d64e1f1 Compare January 8, 2020 21:43
@haojin2 haojin2 force-pushed the np_boolean_mask_assign_broadcast branch from d64e1f1 to b1826d7 Compare January 24, 2020 18:06
@haojin2 haojin2 requested a review from szha as a code owner January 24, 2020 18:06
@haojin2 haojin2 force-pushed the np_boolean_mask_assign_broadcast branch 5 times, most recently from 52658eb to 1514d53 Compare January 30, 2020 20:24
@haojin2 haojin2 force-pushed the np_boolean_mask_assign_broadcast branch 2 times, most recently from af042e8 to aaafc4f Compare February 9, 2020 03:31
@haojin2 haojin2 force-pushed the np_boolean_mask_assign_broadcast branch from aaafc4f to 5a9f923 Compare February 13, 2020 04:52
@reminisce reminisce merged commit 9ee4f04 into apache:master Feb 15, 2020
zheyuye pushed a commit to zheyuye/incubator-mxnet that referenced this pull request Feb 19, 2020
…#17131)

* support broadcasting on the indexed axis

* support extra cases for broadcasting setitem, fixing a few other bugs in indexing
anirudh2290 pushed a commit to anirudh2290/mxnet that referenced this pull request May 29, 2020
…#17131)

* support broadcasting on the indexed axis

* support extra cases for broadcasting setitem, fixing a few other bugs in indexing
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.

2 participants