mirror of
https://gitlab.com/libeigen/eigen.git
synced 2024-12-21 07:19:46 +08:00
Return the proper size (ie 1) for tensors of rank 0
This commit is contained in:
parent
d14105f158
commit
f100d1494c
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user