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::type Scalar; typedef typename T::Index Index; typedef typename TensorEvaluator, 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::value == 1) { Map > array(const_cast(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, DefaultDevice>::Layout; Map > matrix(const_cast(tensor.data()), first_dim, total_size/first_dim); os << matrix;