From f0ce85b757ce237d763d7751bda61901e78d5dc8 Mon Sep 17 00:00:00 2001 From: Benoit Steiner Date: Mon, 29 Jun 2015 14:04:15 -0700 Subject: Improved support for fixed size tensors --- unsupported/Eigen/CXX11/src/Tensor/Tensor.h | 22 ++++++++++++++++++++++ 1 file changed, 22 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 4dbdbfb3e..24953ec94 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/Tensor.h +++ b/unsupported/Eigen/CXX11/src/Tensor/Tensor.h @@ -375,6 +375,28 @@ class Tensor : public TensorBase + EIGEN_DEVICE_FUNC + void resize(const Sizes& dimensions) { + array dims; + for (int i = 0; i < NumIndices; ++i) { + dims[i] = dimensions[i]; + } + resize(dims); + } +#else + template + EIGEN_DEVICE_FUNC + void resize(const Sizes& dimensions) { + array dims; + for (int i = 0; i < NumIndices; ++i) { + dims[i] = dimensions[i]; + } + resize(dims); + } +#endif + protected: bool checkIndexRange(const array& indices) const -- cgit v1.2.3