tvm_ffi.libinfo.load_lib_module

tvm_ffi.libinfo.load_lib_module#

tvm_ffi.libinfo.load_lib_module(package, target_name, keep_module_alive=True, extra_lib_paths=None)[source]#

Load the tvm_ffi shared library by searching likely paths.

Parameters:
  • package (str) – The package name where the library is expected to be found. For example, "apache-tvm-ffi" is the package name of tvm-ffi.

  • target_name (str) – Name of the CMake target, e.g., "tvm_ffi". It is used to derive the platform-specific shared library name, e.g., "libtvm_ffi.so" on Linux, "tvm_ffi.dll" on Windows.

  • keep_module_alive (bool, default: True) – Whether to keep the loaded module alive to prevent it from being unloaded.

  • extra_lib_paths (list[Path] | None, default: None) – Optional list of additional directories to search for the shared library before falling back to the built-in dev candidates and PATH-derived dirs. Useful when the caller’s package does not ship a wheel-style RECORD but knows where its build artifacts land (e.g. <worktree>/build/lib). Every element must be a pathlib.Path.

Return type:

Module

Returns:

The loaded shared library.