Return the proper size (ie 1) for tensors of rank 0

This commit is contained in:
Benoit Steiner 2016-04-29 18:14:33 -07:00
parent d14105f158
commit f100d1494c

View File

@ -275,7 +275,7 @@ struct DSizes : array<DenseIndex, NumDims> {
}
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE DenseIndex TotalSize() const {
return internal::array_prod(*static_cast<const Base*>(this));
return (NumDims == 0) ? 1 : internal::array_prod(*static_cast<const Base*>(this));
}
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE DSizes() {