microsoft/onnxruntime-extensions
Publicmirrored fromhttps://github.com/microsoft/onnxruntime-extensionsAvailable
onnxruntime_extensions/__init__.py
35lines · 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 entry point to onnxruntime custom op library |
| 8 | """ |
| 9 | |
| 10 | __author__ = "Microsoft" |
| 11 | |
| 12 | import pathlib |
| 13 | import inspect |
| 14 | from ._version import __version__ |
| 15 | from ._ocos import get_library_path # noqa |
| 16 | from ._ocos import Opdef, PyCustomOpDef # noqa |
| 17 | from ._ocos import hash_64 # noqa |
| 18 | from ._ocos import enable_py_op # noqa |
| 19 | from ._ocos import expand_onnx_inputs # noqa |
| 20 | from ._ocos import hook_model_op # noqa |
| 21 | from ._ocos import default_opset_domain # noqa |
| 22 | from ._cuops import * # noqa |
| 23 | from ._ortapi2 import OrtPyFunction as PyOrtFunction |
| 24 | from ._ortapi2 import OrtPyFunction, optimize_model, make_onnx_model |
| 25 | |
| 26 | |
| 27 | onnx_op = Opdef.declare |
| 28 | PyOp = PyCustomOpDef |
| 29 | |
| 30 | |
| 31 | # do a favour for the unit test. |
| 32 | def get_test_data_file(*sub_dirs): |
| 33 | case_file = inspect.currentframe().f_back.f_code.co_filename |
| 34 | test_dir = pathlib.Path(case_file).parent |
| 35 | return str(test_dir.joinpath(*sub_dirs).resolve()) |
| 36 | |