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

Showing proper error when csr array is not 2D in shape. #15242

Merged
merged 3 commits into from
Jun 20, 2019

Conversation

piyushghai
Copy link
Contributor

@piyushghai piyushghai commented Jun 13, 2019

Description

Fixes #15239 We were allowing non 2D NDArrays to be created as a CSR that caused inconsistencies and also caused a crash when one tried to access .data on a CSR Matrix. The crash was coming from here : https://github.com/apache/incubator-mxnet/blob/master/src/operator/tensor/cast_storage-inl.h#L238.
The other places constructing CSRNDArray are already guarded by the shape checks.

Checklist

Essentials

Please feel free to remove inapplicable items for your PR.

  • 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 http://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
  • To the my best knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change

@piyushghai piyushghai requested a review from szha as a code owner June 13, 2019 20:27
@piyushghai
Copy link
Contributor Author

@eric-haibin-lin Please review.

@vandanavk
Copy link
Contributor

@mxnet-label-bot add [Python, pr-awaiting-review]

@marcoabreu marcoabreu added pr-awaiting-review PR is waiting for code review Python labels Jun 14, 2019
Copy link
Member

@wkcn wkcn left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you!

@eric-haibin-lin eric-haibin-lin merged commit 2de0db0 into apache:master Jun 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pr-awaiting-review PR is waiting for code review Python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Performing operations on 1-D CSR NDArray results in exception
5 participants