use thiserror::Error;
pub type Result<T> = std::result::Result<T, BitNetError>;
#[derive(Debug, Error)]
pub enum BitNetError {
#[error("invalid configuration: {0}")]
InvalidConfig(String),
#[error("shape mismatch: expected {expected:?}, got {actual:?}")]
ShapeMismatch {
expected: Vec<usize>,
actual: Vec<usize>,
},
#[error("dimension mismatch: expected {expected}, got {actual}")]
DimensionMismatch {
expected: usize,
actual: usize,
},
#[error("quantization error: {0}")]
Quantization(String),
#[error("tensor error: {0}")]
Tensor(#[from] candle_core::Error),
#[error("ternary error: {0}")]
Ternary(#[from] trit_vsa::TernaryError),
#[error("I/O error: {0}")]
Io(#[from] std::io::Error),
#[error("serialization error: {0}")]
Serialization(String),
#[error("feature not available: {0}")]
FeatureNotAvailable(String),
}