Improve how we check that the dims are in bounds.

This commit is contained in:
laurent
2023-06-30 09:11:00 +01:00
parent 00476d37f8
commit 19cbbc5212
3 changed files with 35 additions and 8 deletions

View File

@ -10,6 +10,13 @@ pub enum Error {
got: DType,
},
#[error("{op}: dimension index {dim} out of range for {shape:?}")]
DimOutOfRange {
shape: Shape,
dim: usize,
op: &'static str,
},
#[error("invalid args for narrow: {shape:?}, dim: {dim}, start: {start}, len:{len}")]
NarrowInvalidArgs {
shape: Shape,