asitstands opened a new pull request #10440:  Fix an ndarray indexing bug with 
index -1
   ## Description ##
   x = mx.nd.array([[1,2,3],[4,5,6]])
   print(x[-1,:])  # MXNetError
   print(x[:,-1])  # MXNetError
   print(x[-1,-1]) # MXNetError
   This produces MXNetErrors while it is expected to print `[1, 4]`, `[3, 6]` 
and `6`. Other negative indices (-2 and -3) work as expected and expressions 
like `x[-1]` and `x[:,-2:-1]` are also ok. So the error occurs only if -1 is 
used in a multidimensional index but not a part of a slice expression. This PR 
fixes the bug.
   ## 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)
   - [x] Changes are complete (i.e. I finished coding on this PR)
   - [x] 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, 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$PR_ID/$BUILD_ID/index.html
   - [x] To the my best knowledge, examples are either not affected by this 
change, or have been fixed to be compatible with this change

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:

With regards,
Apache Git Services

Reply via email to