Add some basic test.

This commit is contained in:
laurent
2023-06-19 19:50:17 +01:00
parent 8e2c534d1f
commit 634e0c88ae
4 changed files with 84 additions and 1 deletions

19
src/error.rs Normal file
View 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>;