diff options
Diffstat (limited to 'candle-core/src/tensor_cat.rs')
-rw-r--r-- | candle-core/src/tensor_cat.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/candle-core/src/tensor_cat.rs b/candle-core/src/tensor_cat.rs index 204e7fd6..be6dfe61 100644 --- a/candle-core/src/tensor_cat.rs +++ b/candle-core/src/tensor_cat.rs @@ -1,4 +1,4 @@ -use crate::{shape::Dim, Error, Result, Shape, Tensor}; +use crate::{shape::Dim, Context, Error, Result, Shape, Tensor}; impl Tensor { /// Concatenates two or more tensors along a particular dimension. @@ -134,7 +134,7 @@ impl Tensor { .bt())? } } - let next_offset = offsets.last().unwrap() + arg.elem_count(); + let next_offset = offsets.last().context("empty offsets")? + arg.elem_count(); offsets.push(next_offset); } let shape = Shape::from(cat_dims); |