#[non_exhaustive]pub enum InferenceError {
ModelLoadFailed {
path: String,
reason: String,
},
InputShapeMismatch {
expected: Vec<usize>,
actual: Vec<usize>,
},
OutputShapeMismatch {
expected: Vec<usize>,
actual: Vec<usize>,
},
GpuError {
message: String,
},
InferenceFailed {
message: String,
},
ModelNotInitialized {
name: String,
},
UnsupportedFormat {
format: String,
},
QuantizationError {
message: String,
},
InvalidBatchSize {
size: usize,
max_size: usize,
},
}Expand description
Errors related to neural network inference.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
ModelLoadFailed
Model file not found or could not be loaded
InputShapeMismatch
Input tensor shape mismatch
OutputShapeMismatch
Output tensor shape mismatch
GpuError
CUDA/GPU error
InferenceFailed
Model inference failed
ModelNotInitialized
Model not initialized
UnsupportedFormat
Unsupported model format
QuantizationError
Quantization error
InvalidBatchSize
Batch size error
Implementations§
Source§impl InferenceError
impl InferenceError
Sourcepub const fn is_recoverable(&self) -> bool
pub const fn is_recoverable(&self) -> bool
Returns true if this error is recoverable.
Trait Implementations§
Source§impl Debug for InferenceError
impl Debug for InferenceError
Source§impl Display for InferenceError
impl Display for InferenceError
Source§impl Error for InferenceError
impl Error for InferenceError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<InferenceError> for CoreError
impl From<InferenceError> for CoreError
Source§fn from(source: InferenceError) -> Self
fn from(source: InferenceError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for InferenceError
impl RefUnwindSafe for InferenceError
impl Send for InferenceError
impl Sync for InferenceError
impl Unpin for InferenceError
impl UnsafeUnpin for InferenceError
impl UnwindSafe for InferenceError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more