use thiserror::Error;
pub type QuantResult<T> = Result<T, QuantError>;
#[derive(Error, Debug)]
pub enum QuantError {
#[error("Invalid block size: {0}")]
InvalidBlockSize(usize),
#[error("Invalid quantization type: {0}")]
InvalidQuantType(String),
#[error("Shape mismatch: expected {expected:?}, got {actual:?}")]
ShapeMismatch {
expected: Vec<usize>,
actual: Vec<usize>,
},
#[error("Data length mismatch: expected {expected}, got {actual}")]
DataLengthMismatch {
expected: usize,
actual: usize,
},
#[error("Calibration error: {0}")]
CalibrationError(String),
#[error("Numerical overflow during quantization")]
Overflow,
#[error("Invalid quantized data: {0}")]
InvalidData(String),
#[error("Tensor conversion error: {0}")]
TensorConversion(String),
}