-
public class Module.Companion
-
-
Field Summary
Fields Modifier and Type Field Description private final IntegerLOAD_MODE_FILEprivate final IntegerLOAD_MODE_MMAPprivate final IntegerLOAD_MODE_MMAP_USE_MLOCKprivate final IntegerLOAD_MODE_MMAP_USE_MLOCK_IGNORE_ERRORSpublic final static Module.CompanionINSTANCE
-
Method Summary
Modifier and Type Method Description final Moduleload(String modelPath, Integer loadMode, Integer numThreads)Loads a serialized ExecuTorch module from the specified path on the disk. final Moduleload(String modelPath, Integer loadMode)Loads a serialized ExecuTorch module from the specified path on the disk. final Moduleload(String modelPath)Loads a serialized ExecuTorch module from the specified path on the disk. final Moduleload(String modelPath, BackendOptionsMap options, Integer loadMode, Integer numThreads)Loads a serialized ExecuTorch module and applies per-backend options at delegate-init (load) time. final Moduleload(String modelPath, BackendOptionsMap options, Integer loadMode)Loads a serialized ExecuTorch module and applies per-backend options at delegate-init (load) time. final Moduleload(String modelPath, BackendOptionsMap options)Loads a serialized ExecuTorch module and applies per-backend options at delegate-init (load) time. final Array<String>readLogBufferStatic()final IntegergetLOAD_MODE_FILE()Load mode for the module. final IntegergetLOAD_MODE_MMAP()Load mode for the module. final IntegergetLOAD_MODE_MMAP_USE_MLOCK()Load mode for the module. final IntegergetLOAD_MODE_MMAP_USE_MLOCK_IGNORE_ERRORS()Load mode for the module. -
-
Method Detail
-
load
@JvmOverloads() final Module load(String modelPath, Integer loadMode, Integer numThreads)
Loads a serialized ExecuTorch module from the specified path on the disk.
- Parameters:
modelPath- path to file that contains the serialized ExecuTorch module.loadMode- load mode for the module.numThreads- the number of threads to use for inference.
-
load
@JvmOverloads() final Module load(String modelPath, Integer loadMode)
Loads a serialized ExecuTorch module from the specified path on the disk.
- Parameters:
modelPath- path to file that contains the serialized ExecuTorch module.loadMode- load mode for the module.
-
load
@JvmOverloads() final Module load(String modelPath)
Loads a serialized ExecuTorch module from the specified path on the disk.
- Parameters:
modelPath- path to file that contains the serialized ExecuTorch module.
-
load
@JvmOverloads() final Module load(String modelPath, BackendOptionsMap options, Integer loadMode, Integer numThreads)
Loads a serialized ExecuTorch module and applies per-backend options at delegate-init (load) time. Prefer this over a process-global setter: the options travel with the load, so there is no ordering or thread-safety hazard to manage.
- Parameters:
modelPath- path to file that contains the serialized ExecuTorch module.options- backend options to apply at load, e.g.loadMode- load mode for the module.numThreads- the number of threads to use for inference.
-
load
@JvmOverloads() final Module load(String modelPath, BackendOptionsMap options, Integer loadMode)
Loads a serialized ExecuTorch module and applies per-backend options at delegate-init (load) time. Prefer this over a process-global setter: the options travel with the load, so there is no ordering or thread-safety hazard to manage.
- Parameters:
modelPath- path to file that contains the serialized ExecuTorch module.options- backend options to apply at load, e.g.loadMode- load mode for the module.
-
load
@JvmOverloads() final Module load(String modelPath, BackendOptionsMap options)
Loads a serialized ExecuTorch module and applies per-backend options at delegate-init (load) time. Prefer this over a process-global setter: the options travel with the load, so there is no ordering or thread-safety hazard to manage.
- Parameters:
modelPath- path to file that contains the serialized ExecuTorch module.options- backend options to apply at load, e.g.
-
readLogBufferStatic
final Array<String> readLogBufferStatic()
-
getLOAD_MODE_FILE
final Integer getLOAD_MODE_FILE()
Load mode for the module. Load the whole file as a buffer.
-
getLOAD_MODE_MMAP
final Integer getLOAD_MODE_MMAP()
Load mode for the module. Use mmap to load pages into memory.
-
getLOAD_MODE_MMAP_USE_MLOCK
final Integer getLOAD_MODE_MMAP_USE_MLOCK()
Load mode for the module. Use memory locking and handle errors.
-
getLOAD_MODE_MMAP_USE_MLOCK_IGNORE_ERRORS
final Integer getLOAD_MODE_MMAP_USE_MLOCK_IGNORE_ERRORS()
Load mode for the module. Use memory locking and ignore errors.
-
-
-
-