pub enum PriorError {
UnknownMagic([u8; 4]),
Truncated(String),
UnsupportedVersion(u32),
InvalidMetadata(String),
DuplicateTensor(String),
InvalidShape {
name: String,
shape: Vec<usize>,
},
UnsupportedBitWidth {
name: String,
bits: u8,
},
SizeMismatch {
name: String,
detail: String,
},
TrailingBytes,
Validation(String),
Io(Error),
Json(Error),
}Expand description
Errors returned when reading, writing, or validating quantized prior archives.
Variants§
UnknownMagic([u8; 4])
Archive header magic is not one of QPR1, QPI1, LRA1, or QLA1.
Truncated(String)
Archive ended before header, metadata, or tensor payload finished.
UnsupportedVersion(u32)
Archive metadata version is unsupported.
InvalidMetadata(String)
Archive metadata contains invalid tensor descriptors.
DuplicateTensor(String)
Archive defines the same tensor name twice.
InvalidShape
Tensor shape is empty or contains a zero dimension.
UnsupportedBitWidth
Bit width is not one of 1, 2, 4, 8, or 16.
SizeMismatch
Entry byte count or scale count does not match its shape and bit width.
TrailingBytes
Unexpected data found after the final tensor entry.
Validation(String)
Prior initialization metadata does not match the target model or vocabulary.
Io(Error)
Underlying I/O error.
Json(Error)
JSON metadata parsing or serialization error.
Trait Implementations§
Source§impl Debug for PriorError
impl Debug for PriorError
Source§impl Display for PriorError
impl Display for PriorError
Source§impl Error for PriorError
impl Error for PriorError
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<Error> for PriorError
impl From<Error> for PriorError
Auto Trait Implementations§
impl !RefUnwindSafe for PriorError
impl !UnwindSafe for PriorError
impl Freeze for PriorError
impl Send for PriorError
impl Sync for PriorError
impl Unpin for PriorError
impl UnsafeUnpin for PriorError
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