-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support to dump unsupported ops. Add lite_interpter_load test. (#…
…34072) Summary: Pull Request resolved: pytorch/pytorch#34072 This diff helps check all the ops not supported by lite_interpreter. Helpful mainly to find all the ops that need to be added instead of adding them one by one. Test Plan: buck run caffe2/binaries:lite_interpreter_model_load -- --model=<bytecode-model-path> Reviewed By: iseeyuan Differential Revision: D20194092 fbshipit-source-id: 0d596cd0204308027194af7ed738551d0c32a374
- Loading branch information
1 parent
385067e
commit 17a5c67
Showing
4 changed files
with
54 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#include "ATen/ATen.h" | ||
#include <torch/csrc/jit/api/module.h> | ||
#include <torch/csrc/autograd/generated/variable_factories.h> | ||
#include <torch/csrc/jit/mobile/import.h> | ||
#include <torch/csrc/jit/mobile/module.h> | ||
#include <torch/csrc/jit/serialization/import.h> | ||
#include "torch/script.h" | ||
|
||
C10_DEFINE_string(model, "", "The given bytecode model to check if it is supported by lite_interpreter."); | ||
|
||
int main(int argc, char** argv) { | ||
c10::SetUsageMessage( | ||
"Check if exported bytecode model is runnable by lite_interpreter.\n" | ||
"Example usage:\n" | ||
"./lite_interpreter_model_load" | ||
" --model=<model_file>"); | ||
|
||
if (!c10::ParseCommandLineFlags(&argc, &argv)) { | ||
std::cerr << "Failed to parse command line flags!" << std::endl; | ||
return 1; | ||
} | ||
|
||
if (FLAGS_model.empty()) { | ||
std::cerr << FLAGS_model << ":Model file is not provided\n"; | ||
return -1; | ||
} | ||
|
||
torch::jit::mobile::Module bc = torch::jit::_load_for_mobile(FLAGS_model); | ||
return 0; | ||
} |
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