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