Thanks to visit codestin.com
Credit goes to github.com

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

gather_nd: check bound and wrap negative indices#17208

Merged
haojin2 merged 3 commits into
apache:masterfrom
Alicia1529:fix_index_bound
Jan 10, 2020
Merged

gather_nd: check bound and wrap negative indices#17208
haojin2 merged 3 commits into
apache:masterfrom
Alicia1529:fix_index_bound

Conversation

@Alicia1529
Copy link
Copy Markdown
Contributor

@Alicia1529 Alicia1529 commented Jan 3, 2020

  1. check if indices are out of bound

  2. wrap negative indices

  3. move NormalizeError out of c_api_error.h

Copy link
Copy Markdown
Contributor

@reminisce reminisce left a comment

Choose a reason for hiding this comment

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

Please add unit tests for catching IndexError exception.

Comment thread src/operator/tensor/indexing_op.cc Outdated
Comment thread src/operator/tensor/indexing_op.cu Outdated
@haojin2 haojin2 added the Numpy label Jan 6, 2020
Comment thread src/operator/tensor/indexing_op.cu Outdated
@haojin2
Copy link
Copy Markdown
Contributor

haojin2 commented Jan 6, 2020

Maybe also add some tests to verify this new checking.

gather_nd: increase the interpretability of the error msg

gather_nd: update test
Comment thread tests/python/unittest/test_operator.py
Copy link
Copy Markdown
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

@haojin2 haojin2 merged commit 4ed14e2 into apache:master Jan 10, 2020
@eric-haibin-lin
Copy link
Copy Markdown
Member

@szha we should not mix commits in a PR. It makes it hard to search for the commit that fixes " NormalizeError" APIs

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.

4 participants