aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/Eigen/CXX11/src/Tensor/TensorReverse.h
diff options
context:
space:
mode:
authorGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2015-11-13 09:07:27 -0800
committerGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2015-11-13 09:07:27 -0800
commitf1fbd74db9d7c349e6612250d5dd1863c24e8495 (patch)
treed9cccccfd33d9277d7a0639f69469de6ec90ed11 /unsupported/Eigen/CXX11/src/Tensor/TensorReverse.h
parent1e1755352d02dd0abcd1955bc126f50d42ca60ba (diff)
Added sanity check
Diffstat (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorReverse.h')
-rw-r--r--unsupported/Eigen/CXX11/src/Tensor/TensorReverse.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorReverse.h b/unsupported/Eigen/CXX11/src/Tensor/TensorReverse.h
index e092c0e04..10328c61f 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorReverse.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorReverse.h
@@ -66,7 +66,7 @@ class TensorReverseOp : public TensorBase<TensorReverseOp<ReverseDimensions,
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorReverseOp(
const XprType& expr, const ReverseDimensions& reverse_dims)
- : m_xpr(expr), m_reverse_dims(reverse_dims) {}
+ : m_xpr(expr), m_reverse_dims(reverse_dims) { }
EIGEN_DEVICE_FUNC
const ReverseDimensions& reverse() const { return m_reverse_dims; }
@@ -119,6 +119,9 @@ struct TensorEvaluator<const TensorReverseOp<ReverseDimensions, ArgType>, Device
const Device& device)
: m_impl(op.expression(), device), m_reverse(op.reverse())
{
+ // Reversing a scalar isn't supported yet. It would be a no-op anyway.
+ EIGEN_STATIC_ASSERT(NumDims > 0, YOU_MADE_A_PROGRAMMING_MISTAKE);
+
// Compute strides
m_dimensions = m_impl.dimensions();
if (static_cast<int>(Layout) == static_cast<int>(ColMajor)) {