Caffe2 - Python API
A deep learning, cross platform ML framework
__init__.py
1 import functools
2 import types
3 
4 import torch._C as _C
5 
6 TensorProtoDataType = _C._onnx.TensorProtoDataType
7 OperatorExportTypes = _C._onnx.OperatorExportTypes
8 PYTORCH_ONNX_CAFFE2_BUNDLE = _C._onnx.PYTORCH_ONNX_CAFFE2_BUNDLE
9 
10 ONNX_ARCHIVE_MODEL_PROTO_NAME = "__MODEL_PROTO"
11 
12 
14  PROTOBUF_FILE = 1
15  ZIP_ARCHIVE = 2
16  COMPRESSED_ZIP_ARCHIVE = 3
17  DIRECTORY = 4
18 
19 
20 def _export(*args, **kwargs):
21  from torch.onnx import utils
22  return utils._export(*args, **kwargs)
23 
24 
25 def export(*args, **kwargs):
26  from torch.onnx import utils
27  return utils.export(*args, **kwargs)
28 
29 
30 def export_to_pretty_string(*args, **kwargs):
31  from torch.onnx import utils
32  return utils.export_to_pretty_string(*args, **kwargs)
33 
34 
35 def _export_to_pretty_string(*args, **kwargs):
36  from torch.onnx import utils
37  return utils._export_to_pretty_string(*args, **kwargs)
38 
39 
40 def _optimize_trace(trace, operator_export_type):
41  from torch.onnx import utils
42  trace.set_graph(utils._optimize_graph(trace.graph(), operator_export_type))
43 
44 
45 def set_training(*args, **kwargs):
46  from torch.onnx import utils
47  return utils.set_training(*args, **kwargs)
48 
49 
50 def _run_symbolic_function(*args, **kwargs):
51  from torch.onnx import utils
52  return utils._run_symbolic_function(*args, **kwargs)
53 
54 
55 def _run_symbolic_method(*args, **kwargs):
56  from torch.onnx import utils
57  return utils._run_symbolic_method(*args, **kwargs)