modelport_executorch library
PyTorch ExecuTorch adapter for ModelPort.
await ModelPortFlutter.init(adapters: [ExecuTorchAdapter()]);
final classifier = await ImageClassifier.load('hf://org/mobilenet_v3_small');
Classes
- ExecuTorchAdapter
-
Runs
executorchvariants (.pteprograms) throughexecutorch_flutter. - ExecuTorchSession
-
A
.pteprogram loaded with ExecuTorch.
Functions
-
tensorTypeOf(
DType dtype) → TensorType - The ExecuTorch element type for a manifest dtype.
-
toTensor(
DType expected, TensorData output) → Tensor -
Wraps an ExecuTorch output as a
Tensor, checking it has the manifest dtype.