ExecutorchManagerBase class abstract

Base implementation of ExecutorchManager with shared logic

Contains common implementations for model caching, tensor creation, and resource management. Platform-specific managers extend this class.

Implemented types
Available extensions

Constructors

ExecutorchManagerBase()

Properties

hashCode int
The hash code for this object.
no setterinherited
initialized bool
Whether the manager has been initialized (accessible to subclasses)
getter/setter pair
loadedModelsMap Map<String, ExecuTorchModel>
Cache of loaded models by model ID (accessible to subclasses)
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

createTensorData({required List<int> shape, required TensorType dataType, required List<num> data, String? name}) TensorData
Create tensor data with validation
override
disposeAllModels() Future<void>
Dispose all loaded models and free their resources
override
disposeModel(String modelId) Future<void>
Dispose a loaded model and free its resources
override
ensureInitialized() → void
Ensure the manager has been initialized
getLoadedModel(String modelId) ExecuTorchModel?
Get a loaded model by its ID
override
getLoadedModelIds() Future<List<String>>
Get the IDs of all loaded models
override
getLoadedModels() List<ExecuTorchModel>
Get all currently loaded models
override
getMemoryInfo() Future<Map<String, Object>>
Get detailed information about system memory usage
inherited
initialize() Future<void>
Initialize the ExecutorchManager
inherited
isAvailable() Future<bool>
Check if ExecuTorch is properly initialized and available
inherited
loadModel(String filePath) Future<ExecuTorchModel>
Load an ExecuTorch model from a file path
inherited
loadModelFromAssets(String assetPath) Future<ExecuTorchModel>

Available on ExecutorchManager, provided by the ExecutorchManagerAssets extension

Loads a model from the Flutter asset bundle and caches it.
loadModelFromBytes(Uint8List modelBytes) Future<ExecuTorchModel>
Load a model from bytes and cache it.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setDebugLogging(bool enabled) Future<void>
Enable or disable ExecuTorch debug logging
inherited
shutdown() Future<void>
Cleanup resources when the manager is no longer needed
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

convertNumericDataToBytes(List<num> data, TensorType dataType) Uint8List
Utility method to convert numeric data to bytes