Skip to content

Commit

Permalink
Add missing dot-product dimension check.
Browse files Browse the repository at this point in the history
Fix #776
  • Loading branch information
sebcrozet committed Oct 13, 2020
1 parent 07dc799 commit 4da2bfc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/base/blas.rs
Expand Up @@ -289,6 +289,13 @@ where
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
// 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>()) {
Expand Down

0 comments on commit 4da2bfc

Please sign in to comment.