diff options
author | Benoit Steiner <benoit.steiner.goog@gmail.com> | 2016-04-29 18:14:33 -0700 |
---|---|---|
committer | Benoit Steiner <benoit.steiner.goog@gmail.com> | 2016-04-29 18:14:33 -0700 |
commit | f100d1494ced3fdfb2c6a364596fc251a9e6cecc (patch) | |
tree | 161a63f4d4ce57c69206ae28cd3324f878d39a37 /unsupported/Eigen/CXX11 | |
parent | d14105f158a731fb3b02650dde4df58935abd71e (diff) |
Return the proper size (ie 1) for tensors of rank 0
Diffstat (limited to 'unsupported/Eigen/CXX11')
-rw-r--r-- | unsupported/Eigen/CXX11/src/Tensor/TensorDimensions.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDimensions.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDimensions.h index 977dcafb0..f0b8ac958 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorDimensions.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDimensions.h @@ -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() { |