Add missing dot-product dimension check.

Fix #776
This commit is contained in:
Crozet Sébastien 2020-10-13 17:23:08 +02:00
parent 07dc799bbd
commit 4da2bfcb71
1 changed files with 7 additions and 0 deletions

View File

@ -289,6 +289,13 @@ where
rhs.shape(), rhs.shape(),
); );
assert!(
self.ncols() == rhs.ncols(),
"Dot product dimensions mismatch for shapes {:?} and {:?}: left cols != right cols.",
self.shape(),
rhs.shape(),
);
// So we do some special cases for common fixed-size vectors of dimension lower than 8 // So we do some special cases for common fixed-size vectors of dimension lower than 8
// because the `for` loop below won't be very efficient on those. // because the `for` loop below won't be very efficient on those.
if (R::is::<U2>() || R2::is::<U2>()) && (C::is::<U1>() || C2::is::<U1>()) { if (R::is::<U2>() || R2::is::<U2>()) && (C::is::<U1>() || C2::is::<U1>()) {