From 4da2bfcb717764fb6e97df3ea0e9c168776f2c84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Crozet=20S=C3=A9bastien?= Date: Tue, 13 Oct 2020 17:23:08 +0200 Subject: [PATCH] Add missing dot-product dimension check. Fix #776 --- src/base/blas.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/base/blas.rs b/src/base/blas.rs index c0615066..f245f24a 100644 --- a/src/base/blas.rs +++ b/src/base/blas.rs @@ -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::() || R2::is::()) && (C::is::() || C2::is::()) {