Skip to main content

llama_gguf/tensor/
error.rs

1//! Tensor error types
2
3#[derive(thiserror::Error, Debug)]
4pub enum TensorError {
5    #[error("Shape mismatch: expected {expected} elements, got {got}")]
6    ShapeMismatch { expected: usize, got: usize },
7
8    #[error("Size mismatch: expected {expected} bytes, got {got}")]
9    SizeMismatch { expected: usize, got: usize },
10
11    #[error("Invalid dtype for operation")]
12    InvalidDType,
13
14    #[error("Tensor is not contiguous")]
15    NotContiguous,
16}