This repository was archived by the owner on Nov 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
[1.x] Backporting #18779 to v1.x #18894
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
6cb4dd3
initial commit
c7734dd
Support extra inputs for subgraph ops (#18779)
samskalicky f5abf26
changed messages
5c583c2
changed to pointers and types
0a9302c
added cast
db223ab
updated cast
a4b15f6
fixed signed int
9efad5a
whitespace
d623aba
Merge branch 'v1.x' of https://github.com/apache/incubator-mxnet into…
195232b
fixd pass resource
7e2a19c
Merge branch 'v1.x' of https://github.com/apache/incubator-mxnet into…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,6 +26,8 @@ | |
| #include <iostream> | ||
| #include "lib_api.h" | ||
|
|
||
| using namespace mxnet::ext; | ||
|
|
||
| void transpose(MXTensor& src, MXTensor& dst, const OpResource& res) { | ||
| MXSparse* A = src.data<MXSparse>(); | ||
| MXSparse* B = dst.data<MXSparse>(); | ||
|
|
@@ -73,11 +75,11 @@ MXReturnValue forward(const std::unordered_map<std::string, std::string>& attrs, | |
| // The data types and storage types of inputs and outputs should be the same. | ||
| if(inputs->at(0).dtype != outputs->at(0).dtype || | ||
| inputs->at(0).stype != outputs->at(0).stype) { | ||
| std::cout << "Error! Expected all inputs and outputs to be the same type." | ||
| << "Found input storage type:" << inputs->at(0).stype | ||
| << " Found output storage type:" << outputs->at(0).stype | ||
| << " Found input data type:" << inputs->at(0).dtype | ||
| << " Found output data type:" << outputs->at(0).dtype << std::endl; | ||
| MX_ERROR_MSG << "Error! Expected all inputs and outputs to be the same type." | ||
| << "Found input storage type:" << inputs->at(0).stype | ||
| << " Found output storage type:" << outputs->at(0).stype | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unwanted whitespaces?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Thanks! will add these todos to my next PR |
||
| << " Found input data type:" << inputs->at(0).dtype | ||
| << " Found output data type:" << outputs->at(0).dtype; | ||
| return MX_FAIL; | ||
| } | ||
| transpose(inputs->at(0), outputs->at(0), res); | ||
|
|
@@ -103,11 +105,11 @@ MXReturnValue inferType(const std::unordered_map<std::string, std::string>& attr | |
| std::vector<int>* outtypes) { | ||
| // validate inputs | ||
| if (intypes->size() != 1) { | ||
| std::cout << "Expected 1 inputs to inferType" << std::endl; | ||
| MX_ERROR_MSG << "Expected 1 inputs to inferType"; | ||
| return MX_FAIL; | ||
| } | ||
| if (intypes->at(0) != kFloat32) { | ||
| std::cout << "Expected input to have float32 type" << std::endl; | ||
| MX_ERROR_MSG << "Expected input to have float32 type"; | ||
| return MX_FAIL; | ||
| } | ||
|
|
||
|
|
@@ -119,7 +121,7 @@ MXReturnValue inferSType(const std::unordered_map<std::string, std::string>& att | |
| std::vector<int>* instypes, | ||
| std::vector<int>* outstypes) { | ||
| if (instypes->at(0) != kRowSparseStorage) { | ||
| std::cout << "Expected storage type is kRowSparseStorage" << std::endl; | ||
| MX_ERROR_MSG << "Expected storage type is kRowSparseStorage"; | ||
| return MX_FAIL; | ||
| } | ||
| outstypes->at(0) = instypes->at(0); | ||
|
|
@@ -131,7 +133,7 @@ MXReturnValue inferShape(const std::unordered_map<std::string, std::string>& att | |
| std::vector<std::vector<unsigned int>>* outshapes) { | ||
| // validate inputs | ||
| if (inshapes->size() != 1) { | ||
| std::cout << "Expected 1 inputs to inferShape" << std::endl; | ||
| MX_ERROR_MSG << "Expected 1 inputs to inferShape"; | ||
| return MX_FAIL; | ||
| } | ||
|
|
||
|
|
@@ -196,7 +198,7 @@ MXReturnValue initialize(int version) { | |
| std::cout << "MXNet version " << version << " supported" << std::endl; | ||
| return MX_SUCCESS; | ||
| } else { | ||
| std::cout << "MXNet version " << version << " not supported" << std::endl; | ||
| MX_ERROR_MSG << "MXNet version " << version << " not supported"; | ||
| return MX_FAIL; | ||
| } | ||
| } | ||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.