Another fix for squeezing. (#1943)

This commit is contained in:
Laurent Mazare
2024-03-26 17:05:26 +01:00
committed by GitHub
parent 4523ecfb2a
commit 66f0a4eeea
2 changed files with 4 additions and 4 deletions

View File

@ -171,7 +171,7 @@ impl Shape {
}
let mut acc = 1;
for (&stride, &dim) in stride.iter().zip(self.0.iter()).rev() {
if stride != acc {
if dim > 1 && stride != acc {
return false;
}
acc *= dim;
@ -186,7 +186,7 @@ impl Shape {
}
let mut acc = 1;
for (&stride, &dim) in stride.iter().zip(self.0.iter()) {
if stride != acc {
if dim > 1 && stride != acc {
return false;
}
acc *= dim;