-
Notifications
You must be signed in to change notification settings - Fork 676
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
Add tensor setter feature with advanced indexing on PyTorch engine #1755
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
KexinFeng
changed the title
Add tensor setter feature with advanced indexing on PyTorch engine
[WIP] Add tensor setter feature with advanced indexing on PyTorch engine
Jun 28, 2022
KexinFeng
force-pushed
the
pt_torch_setter2
branch
from
June 28, 2022 21:16
e2f2d81
to
50fc02e
Compare
Codecov Report
@@ Coverage Diff @@
## master #1755 +/- ##
============================================
- Coverage 72.08% 70.55% -1.53%
- Complexity 5126 5583 +457
============================================
Files 473 527 +54
Lines 21970 24789 +2819
Branches 2351 2699 +348
============================================
+ Hits 15838 17491 +1653
- Misses 4925 5962 +1037
- Partials 1207 1336 +129
Continue to review full report at Codecov.
|
KexinFeng
force-pushed
the
pt_torch_setter2
branch
from
June 29, 2022 19:47
f55102f
to
63c25af
Compare
KexinFeng
changed the title
[WIP] Add tensor setter feature with advanced indexing on PyTorch engine
Add tensor setter feature with advanced indexing on PyTorch engine
Jun 29, 2022
KexinFeng
force-pushed
the
pt_torch_setter2
branch
from
July 1, 2022 02:00
63c25af
to
e68031b
Compare
Fix NDIndexTest javadoc fix Remove shape check Add `put` Pt engine support Add NDIndeTest fix NDArray.get(index) testIndexationUsesSpecificManager add manager checking into PtNDArrayIndexer get(NDArray, NDIndex) Add :engines:pytorch:pytorch-jni change at::indexing to torch::indexing; testRuntimeOnly project(":engines:pytorch:pytorch-jni Restore the get(NDArray, NDIndex) Torch index type check: long, byte or boolean; restore testPick behaviour; The previous commit: PtNDManager.from() bug fixed. bug fixed bug fixed Update api/src/main/java/ai/djl/ndarray/index/dim/NDIndexNone.java Co-authored-by: Frank Liu <[email protected]> bug fixed feed std::vector<> to tensor.index(ArrayRef<>) code cleaning 2 code cleaning mixed index getter on pytorch draft
KexinFeng
force-pushed
the
pt_torch_setter2
branch
from
July 1, 2022 02:21
e68031b
to
51444b0
Compare
lanking520
approved these changes
Jul 5, 2022
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.
Description
Full support of setting with pytorch indexing
Add tensor setter feature with advanced indexing on PyTorch engine. This is the counterpart of the getter feature in one previous PR. Advanced indexing that supports all indexing features on PyTorch #1719
This PR succeeds Add put feature with linear indexing on PyTorch engine #1749.
Demo example
See the following code for demo
djl/integration/src/main/java/ai/djl/integration/tests/ndarray/NDIndexTest.java
Lines 153 to 178 in f040c38
djl/integration/src/main/java/ai/djl/integration/tests/ndarray/NDIndexTest.java
Lines 194 to 215 in f040c38
djl/integration/src/main/java/ai/djl/integration/tests/ndarray/NDIndexTest.java
Lines 246 to 268 in f040c38
The relavant preceding PRs
Advanced indexing that supports all indexing features on PyTorch #1719
Add put feature with linear indexing on PyTorch engine #1749