From f7bb7ee3f36474163da7c7f6f88306d553238df2 Mon Sep 17 00:00:00 2001 From: Benoit Steiner Date: Tue, 22 Jul 2014 10:31:21 -0700 Subject: Fixed the assignment operator of the Tensor and TensorMap classes. --- unsupported/Eigen/CXX11/src/Tensor/Tensor.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'unsupported/Eigen/CXX11/src/Tensor/Tensor.h') diff --git a/unsupported/Eigen/CXX11/src/Tensor/Tensor.h b/unsupported/Eigen/CXX11/src/Tensor/Tensor.h index 09601fc7d..547bb74d1 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/Tensor.h +++ b/unsupported/Eigen/CXX11/src/Tensor/Tensor.h @@ -229,6 +229,17 @@ class Tensor : public TensorBase > EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED } + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Tensor& operator=(const Tensor& other) + { + // FIXME: we need to resize the tensor to fix the dimensions of the other. + // Unfortunately this isn't possible yet when the rhs is an expression. + // resize(other.dimensions()); + typedef TensorAssignOp Assign; + Assign assign(*this, other); + internal::TensorExecutor::run(assign, DefaultDevice()); + return *this; + } template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Tensor& operator=(const OtherDerived& other) -- cgit v1.2.3