Revert "Delete TorchScript based Android demo app and point to ExecuTorch (#153633)"

This reverts commit b22f01fcb9d69bb7d77e08d69004c7265ef7fa4a.

Reverted https://github.com/pytorch/pytorch/pull/153633 on behalf of https://github.com/malfet due to But libtorch build regressions are real, fbjni is still used for C++ builds ([comment](https://github.com/pytorch/pytorch/pull/153633#issuecomment-2884951805))
This commit is contained in:
PyTorch MergeBot
2025-05-15 20:16:05 +00:00
parent b03e4f53d2
commit ae0e8f0c73
118 changed files with 7669 additions and 3 deletions

View File

@ -0,0 +1,20 @@
#include <torch/csrc/jit/api/module.h>
#include <torch/jit.h>
#include <torch/script.h>
#include <fstream>
#include <iostream>
#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);
}