1 #pragma once 2 3 #include <ATen/core/function_schema.h> 4 #include <ATen/core/ivalue.h> 5 #include <ATen/core/jit_type.h> 6 #include <ATen/core/qualified_name.h> 7 #include <torch/csrc/jit/backends/backend_debug_handler.h> 8 #include <torch/csrc/jit/mobile/function.h> 9 #include <torch/csrc/jit/mobile/module.h> 10 #include <torch/csrc/jit/runtime/interpreter.h> 11 #include <torch/csrc/jit/serialization/type_name_uniquer.h> 12 13 namespace torch::jit { 14 15 struct TORCH_API CompilationOptions { 16 bool incl_interface_call = false; 17 bool enable_default_value_for_unspecified_arg = false; 18 bool enable_default_args_before_out_args = true; 19 bool enable_emit_promoted_ops = true; 20 int model_version = caffe2::serialize::kProducedBytecodeVersion; 21 }; 22 23 TORCH_API mobile::Module jitModuleToMobile( 24 const Module& module, 25 const CompilationOptions& options); 26 27 mobile::Code compileGraphToMobileCode( 28 const std::string& name, 29 const std::shared_ptr<Graph>& graph, 30 const CompilationOptions& compilation_options, 31 BackendDebugInfoRecorder& debug_info_recorder); 32 33 TORCH_API std::unique_ptr<mobile::Function> convertJitFunctionToMobileFunction( 34 const GraphFunction& function, 35 const CompilationOptions& options); 36 37 TORCH_API IValue convertMobileFunctionToCodeTable( 38 const mobile::Function& func, 39 const CompilationOptions& compilation_options); 40 41 } // namespace torch::jit 42