From 8a977c1f469df11027ca31efbd246aaa5db5fe65 Mon Sep 17 00:00:00 2001 From: Eugene Zhulenev Date: Thu, 25 Oct 2018 11:31:29 -0700 Subject: Fix cxx11_tensor_{block_access, reduction} tests --- unsupported/test/cxx11_tensor_block_access.cpp | 4 ++-- unsupported/test/cxx11_tensor_reduction.cpp | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/unsupported/test/cxx11_tensor_block_access.cpp b/unsupported/test/cxx11_tensor_block_access.cpp index 64b3a1202..0fb189e09 100644 --- a/unsupported/test/cxx11_tensor_block_access.cpp +++ b/unsupported/test/cxx11_tensor_block_access.cpp @@ -820,8 +820,8 @@ static void test_block_cwise_binary_io_zero_strides() { left_strides[4] = 0; DSizes right_sizes = rnd_dims; - right_sizes[1] = 0; - right_sizes[3] = 0; + right_sizes[1] = 1; + right_sizes[3] = 1; DSizes right_strides(ComputeStrides(right_sizes)); right_strides[1] = 0; diff --git a/unsupported/test/cxx11_tensor_reduction.cpp b/unsupported/test/cxx11_tensor_reduction.cpp index c0d4c786f..996dba806 100644 --- a/unsupported/test/cxx11_tensor_reduction.cpp +++ b/unsupported/test/cxx11_tensor_reduction.cpp @@ -57,6 +57,8 @@ template static void test_simple_reductions() { Tensor tensor(2, 3, 5, 7); tensor.setRandom(); + // Add a little offset so that the product reductions won't be close to zero. + tensor += tensor.constant(Scalar(0.5f)); array reduction_axis2; reduction_axis2[0] = 1; reduction_axis2[1] = 3; @@ -368,7 +370,7 @@ static void test_static_dims() { Tensor out(72, 97); in.setRandom(); -#if !EIGEN_HAS_CONSTEXPR +#if !EIGEN_HAS_CONSTEXPR array reduction_axis; reduction_axis[0] = 1; reduction_axis[1] = 3; -- cgit v1.2.3