Skip to main content

Crate mnn_runtime

Crate mnn_runtime 

Source
Expand description

Safe, named multi-input/multi-output inference on top of MNN.

The native interpreter and session live on a dedicated worker thread. This keeps raw MNN handles out of application threads, makes Model safely shareable, and guarantees that the session is destroyed before its interpreter. All tensor data currently uses f32, matching the vision models this initial release targets.

Re-exports§

pub use mnn_runtime_sys as sys;

Structs§

InferenceOutput
Inference tensors and timing diagnostics.
Model
A loaded, shareable MNN model.
ModelInfo
Immutable model input/output metadata.
PendingRun
An accepted request. Dropping it cancels work that has not entered MNN. Cancellation does not interrupt an active native call.
RunTimings
Measured wall times for one accepted request.
Runtime
Shareable model factory and process-level MNN execution policy.
RuntimeConfig
Configuration used for subsequently loaded models.
Tensor
Owned f32 tensor passed to or returned from a model.
TensorInfo
Model tensor metadata at load time. Nonpositive dimensions are unresolved. Use returned Tensor shapes for the actual dimensions of a particular run.

Enums§

Backend
MNN execution backend.
Error
MNN runtime error.
ExecutionMode
Coordination policy for multiple models in one process.
GpuMemoryMode
OpenCL tensor storage; ignored by other backends.
GpuTuning
GPU kernel search policy. Fast/Normal are OpenCL-only.
MemoryMode
Backend memory preference passed to MNN.
PowerMode
Power preference passed to MNN.
PrecisionMode
Precision preference passed to MNN.

Type Aliases§

Result
Result type returned by this crate.