Skip to content

Commit 9dfa7ed

Browse files
restore missing dim check logic(removed accidently)
1 parent 0181719 commit 9dfa7ed

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/numeric/impl_numeric.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,11 @@ where
133133
A: Clone + One + Mul<Output = A> + ScalarOperand,
134134
D: Dimension + RemoveAxis,
135135
{
136+
// First check dimensionality
137+
if self.ndim() > 1 && axis.is_none() {
138+
panic!("axis parameter is required for arrays with more than one dimension");
139+
}
140+
136141
let mut res = Array::ones(self.raw_dim());
137142

138143
match axis {

0 commit comments

Comments
 (0)