-
Notifications
You must be signed in to change notification settings - Fork 685
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Backward compatible with MXNet indexing. #1802
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
frankfliu
reviewed
Jul 16, 2022
Co-authored-by: Frank Liu <frankfliu2000@gmail.com>
Co-authored-by: Frank Liu <frankfliu2000@gmail.com>
Co-authored-by: Frank Liu <frankfliu2000@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #1802 +/- ##
============================================
- Coverage 72.08% 69.56% -2.53%
- Complexity 5126 5494 +368
============================================
Files 473 524 +51
Lines 21970 24336 +2366
Branches 2351 2651 +300
============================================
+ Hits 15838 16930 +1092
- Misses 4925 6091 +1166
- Partials 1207 1315 +108
Continue to review full report at Codecov.
|
frankfliu
reviewed
Jul 17, 2022
api/src/main/java/ai/djl/ndarray/index/full/NDIndexFullPick.java
Outdated
Show resolved
Hide resolved
lanking520
approved these changes
Jul 18, 2022
KexinFeng
added a commit
to KexinFeng/djl
that referenced
this pull request
Jul 22, 2022
* backward compatible * backward compatible * error msg * Update api/src/main/java/ai/djl/ndarray/types/Shape.java Co-authored-by: Frank Liu <frankfliu2000@gmail.com> * Update api/src/main/java/ai/djl/ndarray/types/Shape.java Co-authored-by: Frank Liu <frankfliu2000@gmail.com> * Update api/src/main/java/ai/djl/ndarray/types/Shape.java Co-authored-by: Frank Liu <frankfliu2000@gmail.com> * cast type * cast type * Fix issue for unsupported operator * Reformat Co-authored-by: Frank Liu <frankfliu2000@gmail.com>
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This solves the bug reported in issue.
The new feature of indexing is not completely backward compatible, since
NDIndexPick
has been replaced byNDIndexTake
. Now this problem is solved by treatingNDIndexTake
same asNDIndexPick
in FullPick and then used inapi/src/main/java/ai/djl/ndarray/index/NDArrayIndexer.java
line53. . Still, when receivingNDArray
index,NDIndex
will send it toNDIndexTake
as the default defination forNDArray
index. It is only muted toNDIndexPick
on MXNet engine.However, this is a temporary solution, only to make it backward compatible.
NDIndexPick
does not have the same definition asNDIndexTake
when used to index array elements. For example,NDIndexPick
cannot support larger-than-1-rank indexing array, whileNDIndexTake
can. So, as an NDIndexElement,NDIndexPick
should be deprecated in the future.