From 816658dac062f32bb9792bbf035bffb9d8909362 Mon Sep 17 00:00:00 2001 From: KJlaccHoeUM9l Date: Tue, 11 Jan 2022 13:14:23 +0300 Subject: [PATCH] improved usability of TVM EP --- onnxruntime/__init__.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/onnxruntime/__init__.py b/onnxruntime/__init__.py index 25d761da6fcbf..110006f3db00f 100644 --- a/onnxruntime/__init__.py +++ b/onnxruntime/__init__.py @@ -44,6 +44,15 @@ except ImportError: pass +try: + # Working between the C++ and Python parts in TVM EP is done using the PackedFunc and Registry classes. + # In order to use a Python function in C++ code, it must be registered in the global table of functions. + # Registration is carried out through the JIT interface, so it is necessary to call + # special functions for registration. To do this, we need to make the following import. + import onnxruntime.providers.stvm +except ImportError: + pass + from onnxruntime.capi.onnxruntime_validation import package_name, version, cuda_version if version: __version__ = version