aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/Eigen/CXX11/src/Tensor/TensorIO.h
diff options
context:
space:
mode:
authorGravatar Abhijit Kundu <abhijit.kundu@gatech.edu>2015-02-28 21:30:31 -0500
committerGravatar Abhijit Kundu <abhijit.kundu@gatech.edu>2015-02-28 21:30:31 -0500
commitef09ce4552daa4bee80e910f6a1d151e84240a2f (patch)
tree30e8aee5887c46a7963c332836f3f7b0ea93a6bf /unsupported/Eigen/CXX11/src/Tensor/TensorIO.h
parent3a4b6827b4703e906b90700b342c1c42301c556a (diff)
Fix for TensorIO for Fixed sized Tensors.
The following code snippet was failing to compile: TensorFixedSize<double, Sizes<4, 3> > t_4x3; cout << 4x3;
Diffstat (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorIO.h')
-rw-r--r--unsupported/Eigen/CXX11/src/Tensor/TensorIO.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorIO.h b/unsupported/Eigen/CXX11/src/Tensor/TensorIO.h
index a9d0f6c39..bdc6ddb87 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorIO.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorIO.h
@@ -30,14 +30,14 @@ std::ostream& operator << (std::ostream& os, const TensorBase<T, ReadOnlyAccesso
typedef typename internal::remove_const<typename T::Scalar>::type Scalar;
typedef typename T::Index Index;
typedef typename TensorEvaluator<const TensorForcedEvalOp<const T>, DefaultDevice>::Dimensions Dimensions;
- const Index total_size = internal::array_prod(tensor.dimensions());
+ const Index total_size = tensor.dimensions().TotalSize();
// Print the tensor as a 1d vector or a 2d matrix.
if (internal::array_size<Dimensions>::value == 1) {
Map<const Array<Scalar, Dynamic, 1> > array(const_cast<Scalar*>(tensor.data()), total_size);
os << array;
} else {
- const Index first_dim = tensor.dimensions()[0];
+ const Index first_dim = Eigen::internal::array_get<0>(tensor.dimensions());
static const int layout = TensorEvaluator<const TensorForcedEvalOp<const T>, DefaultDevice>::Layout;
Map<const Array<Scalar, Dynamic, Dynamic, layout> > matrix(const_cast<Scalar*>(tensor.data()), first_dim, total_size/first_dim);
os << matrix;