diff options
Diffstat (limited to 'unsupported/test/cxx11_tensor_reduction.cpp')
-rw-r--r-- | unsupported/test/cxx11_tensor_reduction.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/unsupported/test/cxx11_tensor_reduction.cpp b/unsupported/test/cxx11_tensor_reduction.cpp index b2c85a879..e8180c061 100644 --- a/unsupported/test/cxx11_tensor_reduction.cpp +++ b/unsupported/test/cxx11_tensor_reduction.cpp @@ -180,6 +180,23 @@ static void test_simple_reductions() { VERIFY_IS_APPROX(mean1(0), mean2(0)); } + + { + Tensor<int, 1> ints(10); + std::iota(ints.data(), ints.data() + ints.dimension(0), 0); + + TensorFixedSize<bool, Sizes<1> > all; + all = ints.all(); + VERIFY(!all(0)); + all = (ints >= ints.constant(0)).all(); + VERIFY(all(0)); + + TensorFixedSize<bool, Sizes<1> > any; + any = (ints > ints.constant(10)).any(); + VERIFY(!any(0)); + any = (ints < ints.constant(1)).any(); + VERIFY(any(0)); + } } template <int DataLayout> |