3 #include <torch/csrc/jit/ir.h> 4 #include <torch/csrc/jit/script/module.h> 5 #include <torch/csrc/onnx/onnx.h> 20 using RawDataExportMap = std::unordered_map<std::string, at::Tensor>;
22 TORCH_API std::tuple<std::string, RawDataExportMap> export_onnx(
23 const std::shared_ptr<Graph>& graph,
24 const std::vector<at::Tensor>& initializers,
25 int64_t onnx_opset_version,
26 bool defer_weight_export =
false,
27 ::torch::onnx::OperatorExportTypes operator_export_type =
28 ::torch::onnx::OperatorExportTypes::ONNX);
31 TORCH_API std::string pretty_print_onnx(
32 const std::shared_ptr<Graph>& graph,
33 const std::vector<at::Tensor>& initializers,
34 int64_t onnx_opset_version,
35 bool defer_weight_export,
36 ::torch::onnx::OperatorExportTypes operator_export_type =
37 ::torch::onnx::OperatorExportTypes::ONNX,
38 bool google_printer =
false);
40 TORCH_API
void ExportModule(
41 const script::Module& module,
43 const script::ExtraFilesMap& metadata = script::ExtraFilesMap());
45 TORCH_API
void ExportModule(
46 const script::Module& module,
47 const std::string& filename,
48 const script::ExtraFilesMap& metadata = script::ExtraFilesMap());