diff options
Diffstat (limited to 'candle-core/src')
-rw-r--r-- | candle-core/src/error.rs | 2 | ||||
-rw-r--r-- | candle-core/src/shape.rs | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/candle-core/src/error.rs b/candle-core/src/error.rs index d030fab1..be8f7b07 100644 --- a/candle-core/src/error.rs +++ b/candle-core/src/error.rs @@ -30,7 +30,7 @@ pub enum Error { UnsupportedDTypeForOp(DType, &'static str), // === Dimension Index Errors === - #[error("{op}: dimension index {dim} out of range for {shape:?}")] + #[error("{op}: dimension index {dim} out of range for shape {shape:?}")] DimOutOfRange { shape: Shape, dim: i32, diff --git a/candle-core/src/shape.rs b/candle-core/src/shape.rs index 578e8ac9..9617d1ac 100644 --- a/candle-core/src/shape.rs +++ b/candle-core/src/shape.rs @@ -73,6 +73,14 @@ impl From<(usize, usize, usize, usize, usize)> for Shape { } } +impl From<(usize, usize, usize, usize, usize, usize)> for Shape { + fn from(d123456: (usize, usize, usize, usize, usize, usize)) -> Self { + Self(vec![ + d123456.0, d123456.1, d123456.2, d123456.3, d123456.4, d123456.5, + ]) + } +} + impl From<Vec<usize>> for Shape { fn from(dims: Vec<usize>) -> Self { Self(dims) |