tvm_ffi.load_module

Contents

tvm_ffi.load_module#

tvm_ffi.load_module(path, keep_module_alive=True)[source]#

Load module from file.

Parameters:
  • path (str | PathLike) – The path to the module file.

  • keep_module_alive (bool, default: True) – Whether to keep the module alive. If True, the module will be kept alive for the duration of the program until libtvm_ffi.so is unloaded.

Return type:

Module

Returns:

The loaded module

Examples

import tvm_ffi
from pathlib import Path

# Works with string paths
mod = tvm_ffi.load_module("path/to/module.so")
# Also works with pathlib.Path objects
mod = tvm_ffi.load_module(Path("path/to/module.so"))

mod.func_name(*args)

See also

tvm_ffi.Module