diff options
author | Antonio Sanchez <cantonios@google.com> | 2020-11-12 15:59:29 -0800 |
---|---|---|
committer | Antonio Sánchez <cantonios@google.com> | 2020-11-18 18:14:53 +0000 |
commit | 3669498f5a7cce29935386ab5380537b06a58edb (patch) | |
tree | 2a02ff13cc86f107c3e2cb5413137a1dc5c3a997 /unsupported/Eigen/CXX11/src/Tensor/TensorFixedSize.h | |
parent | 60218829b71b2d1c69ec989e47147d35fce980ca (diff) |
Fix rule-of-3 for the Tensor module.
Adds copy constructors to Tensor ops, inherits assignment operators from
`TensorBase`.
Addresses #1863
Diffstat (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorFixedSize.h')
-rw-r--r-- | unsupported/Eigen/CXX11/src/Tensor/TensorFixedSize.h | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorFixedSize.h b/unsupported/Eigen/CXX11/src/Tensor/TensorFixedSize.h index a5be54bcd..ca39bb855 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorFixedSize.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorFixedSize.h @@ -340,27 +340,10 @@ class TensorFixedSize : public TensorBase<TensorFixedSize<Scalar_, Dimensions_, internal::TensorExecutor<const Assign, DefaultDevice>::run(assign, DefaultDevice()); } - EIGEN_DEVICE_FUNC - EIGEN_STRONG_INLINE TensorFixedSize& operator=(const TensorFixedSize& other) - { - // FIXME: check that the dimensions of other match the dimensions of *this. - // Unfortunately this isn't possible yet when the rhs is an expression. - typedef TensorAssignOp<Self, const TensorFixedSize> Assign; - Assign assign(*this, other); - internal::TensorExecutor<const Assign, DefaultDevice>::run(assign, DefaultDevice()); - return *this; - } - template<typename OtherDerived> - EIGEN_DEVICE_FUNC - EIGEN_STRONG_INLINE TensorFixedSize& operator=(const OtherDerived& other) - { - // FIXME: check that the dimensions of other match the dimensions of *this. - // Unfortunately this isn't possible yet when the rhs is an expression. - typedef TensorAssignOp<Self, const OtherDerived> Assign; - Assign assign(*this, other); - internal::TensorExecutor<const Assign, DefaultDevice>::run(assign, DefaultDevice()); - return *this; - } + // FIXME: check that the dimensions of other match the dimensions of *this. + // Unfortunately this isn't possible yet when the rhs is an expression. + EIGEN_TENSOR_INHERIT_ASSIGNMENT_EQUAL_OPERATOR(TensorFixedSize) + protected: EIGEN_DEVICE_FUNC |