mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 05:34:18 +08:00
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/34515 Once upon a time we thought this was necessary. In reality it is not, so removing it. For backcompat, our public interface (defined in `api/`) still has typedefs to the old `script::` names. There was only one collision: `Pass` as a `Stmt` and `Pass` as a graph transform. I renamed one of them. Test Plan: Imported from OSS Differential Revision: D20353503 Pulled By: suo fbshipit-source-id: 48bb911ce75120a8c9e0c6fb65262ef775dfba93
21 lines
450 B
C++
21 lines
450 B
C++
#include <torch/jit.h>
|
|
#include <torch/script.h>
|
|
#include <torch/csrc/jit/api/module.h>
|
|
|
|
#include <iostream>
|
|
#include <fstream>
|
|
#include <string>
|
|
|
|
int main(int argc, char* argv[]) {
|
|
std::string input_file_path{argv[1]};
|
|
std::string output_file_path{argv[2]};
|
|
|
|
std::ifstream ifs(input_file_path);
|
|
std::stringstream buffer;
|
|
buffer << ifs.rdbuf();
|
|
torch::jit::Module m("TestModule");
|
|
|
|
m.define(buffer.str());
|
|
m.save(output_file_path);
|
|
}
|