Package org.apache.tvm
Class Module
java.lang.Object
org.apache.tvm.TVMValue
org.apache.tvm.Module
Container of compiled functions of TVM.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionasModule()
Easy for user to get the instance from returned TVMValue.static boolean
Whether module runtime is enabled for target, e.g., The following code checks if cuda is enabled.Get the entry function.protected void
finalize()
getFunction
(String name) getFunction
(String name, boolean queryImports) Get function from the module.void
importModule
(Module module) Add module to the import list of current one.static Module
static Module
Load module from file.void
release()
Release the Module.typeKey()
Get type key of the module.
-
Field Details
-
handle
public final long handle
-
-
Method Details
-
finalize
-
asModule
Easy for user to get the instance from returned TVMValue. -
release
public void release()Release the Module.We highly recommend you to do this manually since the GC strategy is lazy.
-
entryFunc
Get the entry function.- Returns:
- The entry function if exist
-
getFunction
Get function from the module.- Parameters:
name
- The name of the function.queryImports
- Whether also query modules imported by this module.- Returns:
- The result function.
-
getFunction
-
importModule
Add module to the import list of current one.- Parameters:
module
- The other module.
-
typeKey
Get type key of the module.- Returns:
- type key of the module.
-
load
Load module from file.- Parameters:
path
- The path to the module file.fmt
- The format of the file, if not specified it will be inferred from suffix of the file.- Returns:
- The loaded module
-
load
-
enabled
Whether module runtime is enabled for target, e.g., The following code checks if cuda is enabled. Module.enabled("cuda")- Parameters:
target
- The target device type.- Returns:
- Whether runtime is enabled.
-