diff options
author | Eugene Zhulenev <ezhulenev@google.com> | 2018-10-25 11:31:29 -0700 |
---|---|---|
committer | Eugene Zhulenev <ezhulenev@google.com> | 2018-10-25 11:31:29 -0700 |
commit | 8a977c1f469df11027ca31efbd246aaa5db5fe65 (patch) | |
tree | 288217fd212430e4b36f9c40a169920db4f09311 /unsupported/test/cxx11_tensor_reduction.cpp | |
parent | 1dcf5a6ed8c5878a951b6eb7cbfa473030b3f7a8 (diff) |
Fix cxx11_tensor_{block_access, reduction} tests
Diffstat (limited to 'unsupported/test/cxx11_tensor_reduction.cpp')
-rw-r--r-- | unsupported/test/cxx11_tensor_reduction.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
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 <typename Scalar,int DataLayout> static void test_simple_reductions() { Tensor<Scalar, 4, DataLayout> 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<ptrdiff_t, 2> reduction_axis2; reduction_axis2[0] = 1; reduction_axis2[1] = 3; @@ -368,7 +370,7 @@ static void test_static_dims() { Tensor<float, 2, DataLayout> out(72, 97); in.setRandom(); -#if !EIGEN_HAS_CONSTEXPR +#if !EIGEN_HAS_CONSTEXPR array<int, 2> reduction_axis; reduction_axis[0] = 1; reduction_axis[1] = 3; |