1 #include <torch/jit.h> 2 3 #include <ATen/core/stack.h> 4 #include <torch/csrc/jit/frontend/ir_emitter.h> 5 6 #include <memory> 7 #include <string> 8 9 namespace torch { 10 namespace jit { 11 compile(const std::string & source)12std::shared_ptr<CompilationUnit> compile(const std::string& source) { 13 auto module = std::make_shared<CompilationUnit>(); 14 module->define(std::nullopt, source, nativeResolver(), nullptr); 15 return module; 16 } 17 18 } // namespace jit 19 } // namespace torch 20