Skip to content
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 support of take on MXNet engine #1649

Merged
merged 14 commits into from
Jun 1, 2022

Conversation

KexinFeng
Copy link
Contributor

@KexinFeng KexinFeng commented May 13, 2022

This pr follows #1627

take function in MXNet is defined differently from numpy or pytorch. It is implemented by flatten and take in MXNet.

@KexinFeng KexinFeng changed the title Add support of take to MXNet engine Add support of take on MXNet engine May 13, 2022
@codecov-commenter
Copy link

codecov-commenter commented May 13, 2022

Codecov Report

Merging #1649 (ef526ad) into master (bb5073f) will decrease coverage by 1.24%.
The diff coverage is 62.15%.

@@             Coverage Diff              @@
##             master    #1649      +/-   ##
============================================
- Coverage     72.08%   70.84%   -1.25%     
- Complexity     5126     5448     +322     
============================================
  Files           473      508      +35     
  Lines         21970    23863    +1893     
  Branches       2351     2597     +246     
============================================
+ Hits          15838    16906    +1068     
- Misses         4925     5658     +733     
- Partials       1207     1299      +92     
Impacted Files Coverage Δ
api/src/main/java/ai/djl/modality/cv/Image.java 69.23% <ø> (-4.11%) ⬇️
...rc/main/java/ai/djl/modality/cv/output/Joints.java 71.42% <ø> (ø)
.../main/java/ai/djl/modality/cv/output/Landmark.java 100.00% <ø> (ø)
...main/java/ai/djl/modality/cv/output/Rectangle.java 72.41% <ø> (ø)
...i/djl/modality/cv/translator/BigGANTranslator.java 21.42% <ø> (-5.24%) ⬇️
...odality/cv/translator/BigGANTranslatorFactory.java 33.33% <0.00%> (+8.33%) ⬆️
...nslator/InstanceSegmentationTranslatorFactory.java 14.28% <0.00%> (-3.90%) ⬇️
.../ai/djl/modality/cv/translator/YoloTranslator.java 8.33% <0.00%> (-0.50%) ⬇️
.../modality/cv/translator/YoloTranslatorFactory.java 8.33% <0.00%> (-1.67%) ⬇️
...i/djl/modality/cv/translator/YoloV5Translator.java 5.38% <0.00%> (-0.31%) ⬇️
... and 247 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e9a14c8...ef526ad. Read the comment docs.

throw new UnsupportedOperationException("Not implemented yet.");
MxOpParams params = new MxOpParams();
params.addParam("shape", "(-1,)");
NDList flattened = manager.invoke("reshape", new NDList(this), params);
Copy link
Contributor

Choose a reason for hiding this comment

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

You can just use the external reshape here like NDArray flattened = this.reshape(...) or this.flatten().

@KexinFeng KexinFeng marked this pull request as ready for review May 18, 2022 03:58
@KexinFeng KexinFeng requested a review from frankfliu as a code owner May 18, 2022 03:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants