pub enum Error {
Io(Error),
SafeTensors(SafeTensorError),
Read(Error),
Json(Error),
UnsupportedDtype {
tensor: String,
dtype: Dtype,
},
TensorNotFound(String),
InvalidAxis {
tensor: String,
axis: usize,
rank: usize,
},
InvalidGroupSize(String),
ShapeMismatch {
name: String,
a: Vec<usize>,
b: Vec<usize>,
},
}Expand description
Errors produced by teeny-quant.
Variants§
Io(Error)
An I/O operation (reading/writing a .safetensors file) failed.
SafeTensors(SafeTensorError)
Reading or writing the underlying .safetensors container failed.
Read(Error)
Reading the source checkpoint (via teeny-data) failed.
Json(Error)
Serializing/deserializing quantization metadata as JSON failed.
UnsupportedDtype
A tensor’s source dtype isn’t one this crate knows how to quantize/upcast.
TensorNotFound(String)
A requested tensor doesn’t exist in the source checkpoint.
InvalidAxis
A quantization axis was out of range for the tensor’s rank.
Fields
InvalidGroupSize(String)
A group size of 0 was requested for group-wise quantization.
ShapeMismatch
Two tensors that should describe the same underlying weight (e.g. a weight and its dequantized reconstruction) have different shapes.
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)>
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()
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl !UnwindSafe for Error
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