mirror of
https://github.com/huggingface/candle.git
synced 2025-06-19 19:58:35 +00:00
Add some basic test.
This commit is contained in:
19
src/error.rs
Normal file
19
src/error.rs
Normal file
@ -0,0 +1,19 @@
|
||||
/// Main library error type.
|
||||
#[derive(thiserror::Error, Debug)]
|
||||
pub enum Error {
|
||||
#[error("invalid shapes in {op}, lhs: {lhs:?}, rhs: {rhs:?}")]
|
||||
BinaryInvalidShape {
|
||||
lhs: Vec<usize>,
|
||||
rhs: Vec<usize>,
|
||||
op: &'static str,
|
||||
},
|
||||
|
||||
#[error("unexpected rank, expected: {expected}, got: {got} ({shape:?})")]
|
||||
UnexpectedNumberOfDims {
|
||||
expected: usize,
|
||||
got: usize,
|
||||
shape: Vec<usize>,
|
||||
},
|
||||
}
|
||||
|
||||
pub type Result<T> = std::result::Result<T, Error>;
|
Reference in New Issue
Block a user