microsoft/onnxruntime-extensions
Publicmirrored fromhttps://github.com/microsoft/onnxruntime-extensionsAvailable
onnxruntime_extensions/__init__.py
45lines · modecode
| 1 | # Copyright (c) Microsoft Corporation. All rights reserved. |
| 2 | # Licensed under the MIT License. See License.txt in the project root for |
| 3 | # license information. |
| 4 | ############################################################################### |
| 5 | |
| 6 | """ |
| 7 | The `onnxruntime-extensions` Python package offers an API that allows users to generate models for pre-processing and |
| 8 | post-processing tasks. In addition, it also provides an API to register custom operations implemented in Python. |
| 9 | This enables more flexibility and control over model execution, thus expanding the functionality of the ONNX Runtime. |
| 10 | """ |
| 11 | |
| 12 | __author__ = "Microsoft" |
| 13 | |
| 14 | __all__ = [ |
| 15 | 'gen_processing_models', |
| 16 | 'get_library_path', |
| 17 | 'Opdef', 'onnx_op', 'PyCustomOpDef', 'PyOp', |
| 18 | 'enable_py_op', |
| 19 | 'expand_onnx_inputs', |
| 20 | 'hook_model_op', |
| 21 | 'default_opset_domain', |
| 22 | 'OrtPyFunction', 'PyOrtFunction', |
| 23 | 'optimize_model', |
| 24 | 'make_onnx_model', |
| 25 | 'ONNXRuntimeError', |
| 26 | 'hash_64', |
| 27 | '__version__', |
| 28 | ] |
| 29 | |
| 30 | from ._version import __version__ |
| 31 | from ._ocos import get_library_path |
| 32 | from ._ocos import Opdef, PyCustomOpDef |
| 33 | from ._ocos import hash_64 |
| 34 | from ._ocos import enable_py_op |
| 35 | from ._ocos import expand_onnx_inputs |
| 36 | from ._ocos import hook_model_op |
| 37 | from ._ocos import default_opset_domain |
| 38 | from ._cuops import * # noqa |
| 39 | from ._ortapi2 import OrtPyFunction as PyOrtFunction # backward compatibility |
| 40 | from ._ortapi2 import OrtPyFunction, optimize_model, make_onnx_model, ONNXRuntimeError |
| 41 | from .cvt import gen_processing_models |
| 42 | |
| 43 | # rename the implementation with a more formal name |
| 44 | onnx_op = Opdef.declare |
| 45 | PyOp = PyCustomOpDef |
| 46 | |