-
Notifications
You must be signed in to change notification settings - Fork 352
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(supportedops): Application to dump a list of supported operators
Signed-off-by: Naren Dasan <[email protected]> Signed-off-by: Naren Dasan <[email protected]>
- Loading branch information
1 parent
1c9dfe2
commit 872d9a3
Showing
6 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package(default_visibility = ["//visibility:public"]) | ||
|
||
cc_binary( | ||
name = "supportedops", | ||
srcs = [ | ||
"main.cpp" | ||
], | ||
deps = [ | ||
"//cpp/api:trtorch", | ||
"//core/conversion/converters" | ||
], | ||
) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#include "core/conversion/converters/converters.h" | ||
#include "core/conversion/evaluators/evaluators.h" | ||
|
||
#include <string> | ||
#include <sstream> | ||
#include <vector> | ||
#include <iostream> | ||
|
||
int main(int argc, const char* argv[]) { | ||
std::vector<std::string> converters = trtorch::core::conversion::converters::get_converter_list(); | ||
std::vector<std::string> evaluators = trtorch::core::conversion::evaluators::getEvaluatorList(); | ||
|
||
std::stringstream ss; | ||
|
||
ss << R"TITLE( | ||
================================= | ||
Operators Supported | ||
================================= | ||
)TITLE"; | ||
|
||
ss << R"SEC( | ||
Operators Currently Supported Through Converters | ||
------------------------------------------------- | ||
)SEC"; | ||
|
||
for (auto c : converters) { | ||
ss << "- " << c << std::endl; | ||
} | ||
|
||
ss << R"SEC( | ||
Operators Currently Supported Through Evaluators | ||
------------------------------------------------- | ||
)SEC"; | ||
|
||
for (auto e : evaluators) { | ||
ss << "- " << e << std::endl; | ||
} | ||
|
||
std::ofstream ofs; | ||
ofs.open(argv[1]); | ||
|
||
ofs << ss.rdbuf(); | ||
|
||
return 0; | ||
} |