#[non_exhaustive]pub enum Error {
Show 21 variants
InvalidConfig(String),
BackendNotCompiled {
backend: &'static str,
feature: &'static str,
},
BackendUnavailable(&'static str),
ModelRead {
path: PathBuf,
source: Error,
},
Native {
operation: &'static str,
message: String,
},
DuplicateTensor {
kind: &'static str,
name: String,
},
MissingInput(String),
UnknownTensor {
kind: &'static str,
name: String,
},
ShapeMismatch {
name: String,
expected: Vec<i32>,
actual: Vec<usize>,
},
DataLengthMismatch {
name: String,
expected: usize,
actual: usize,
},
ShapeOverflow {
name: String,
},
UnresolvedShape {
name: String,
},
InvalidShape {
name: String,
shape: Vec<usize>,
},
CacheDirectory {
path: PathBuf,
source: Error,
},
QueueFull,
Cancelled,
DeadlineExceeded,
ThreadCountLimited {
requested: usize,
effective: usize,
},
WorkerStopped,
WorkerPanicked,
ExecutionGatePoisoned,
}Expand description
MNN runtime error.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidConfig(String)
Runtime configuration is invalid.
BackendNotCompiled
The selected backend was not compiled into the binary.
The feature is enabled but the linked MNN library lacks the backend.
ModelRead
A model file could not be read.
Native
The native MNN layer rejected an operation.
DuplicateTensor
A tensor name was repeated.
MissingInput(String)
A required input was not provided.
UnknownTensor
The caller provided a tensor not present in the model.
ShapeMismatch
Tensor shape did not match model metadata.
Fields
DataLengthMismatch
Tensor element count does not match its shape.
Fields
ShapeOverflow
Shape element count overflowed or exceeded native allocation limits.
UnresolvedShape
A shape is not concrete yet.
InvalidShape
Concrete shapes must have positive dimensions and rank at most eight.
CacheDirectory
Cache directory creation failed.
QueueFull
The bounded model queue is full. The request was not accepted.
Cancelled
A queued request was cancelled or its handle was dropped.
DeadlineExceeded
A request deadline or result wait expired.
ThreadCountLimited
The existing native pool cannot satisfy the requested thread count.
Fields
WorkerStopped
A model worker stopped unexpectedly.
WorkerPanicked
A model worker panicked during startup.
ExecutionGatePoisoned
The process-wide execution gate was poisoned by a panic.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()