Caffe2 - C++ API
A deep learning, cross platform ML framework
import_source.h
1 #pragma once
2 
3 #include <torch/csrc/jit/ir.h>
4 #include <torch/csrc/jit/script/compiler.h>
5 #include <torch/csrc/jit/script/module.h>
6 
7 namespace torch {
8 namespace jit {
9 namespace script {
10 // Helpers to define modules and classes from source strings. Used in model
11 // saving/loading, so it expects the format produced by the model exporter.
12 
13 // Add the methods defined in `src` to the module `mod`.
14 TORCH_API void import_methods(
15  const std::shared_ptr<script::Module>& mod,
16  const std::string& src,
17  const std::vector<at::Tensor>& constant_table);
18 
19 // Defined the list of classes in `src`.
20 TORCH_API void import_libs(
21  const std::string& src,
22  const std::vector<at::Tensor>& constant_table);
23 
24 } // namespace script
25 } // namespace jit
26 } // namespace torch
Definition: jit_type.h:17