tvm_ffi.init_ffi_api#
- tvm_ffi.init_ffi_api(namespace, target_module_name=None)[source]#
Initialize register ffi api functions into a given module.
- Parameters:
- Return type:
None
Examples
A typical usage pattern is to create a _ffi_api.py file to register the functions under a given module. The following code populates all registered global functions prefixed with
mypackage.
into the current module, then we can call the function through_ffi_api.func_name(*args)
which will call into the registered global function “mypackage.func_name”.# _ffi_api.py import tvm_ffi tvm_ffi.init_ffi_api("mypackage", __name__)