aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/test/cxx11_tensor_argmax.cpp
diff options
context:
space:
mode:
authorGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2015-11-05 14:22:30 -0800
committerGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2015-11-05 14:22:30 -0800
commit0d15ad80195ec5cd33f057068e34aa7e1dc2b783 (patch)
tree0361e379d2a085193853988e08c17466a93a44df /unsupported/test/cxx11_tensor_argmax.cpp
parentc75a19f81525591631670ded0a551e983677db1f (diff)
Updated the regressions tests that cover full reductions
Diffstat (limited to 'unsupported/test/cxx11_tensor_argmax.cpp')
-rw-r--r--unsupported/test/cxx11_tensor_argmax.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/unsupported/test/cxx11_tensor_argmax.cpp b/unsupported/test/cxx11_tensor_argmax.cpp
index 6eeecb717..482dfa7de 100644
--- a/unsupported/test/cxx11_tensor_argmax.cpp
+++ b/unsupported/test/cxx11_tensor_argmax.cpp
@@ -61,14 +61,14 @@ static void test_argmax_tuple_reducer()
Tensor<Tuple<DenseIndex, float>, 4, DataLayout> index_tuples(2,3,5,7);
index_tuples = tensor.index_tuples();
- Tensor<Tuple<DenseIndex, float>, 1, DataLayout> reduced(1);
+ Tensor<Tuple<DenseIndex, float>, 0, DataLayout> reduced;
DimensionList<DenseIndex, 4> dims;
reduced = index_tuples.reduce(
dims, internal::ArgMaxTupleReducer<Tuple<DenseIndex, float>>());
- Tensor<float, 1, DataLayout> maxi = tensor.maximum();
+ Tensor<float, 0, DataLayout> maxi = tensor.maximum();
- VERIFY_IS_EQUAL(maxi(0), reduced(0).second);
+ VERIFY_IS_EQUAL(maxi(), reduced(0).second);
array<DenseIndex, 3> reduce_dims;
for (int d = 0; d < 3; ++d) reduce_dims[d] = d;
@@ -93,14 +93,14 @@ static void test_argmin_tuple_reducer()
Tensor<Tuple<DenseIndex, float>, 4, DataLayout> index_tuples(2,3,5,7);
index_tuples = tensor.index_tuples();
- Tensor<Tuple<DenseIndex, float>, 1, DataLayout> reduced(1);
+ Tensor<Tuple<DenseIndex, float>, 0, DataLayout> reduced;
DimensionList<DenseIndex, 4> dims;
reduced = index_tuples.reduce(
dims, internal::ArgMinTupleReducer<Tuple<DenseIndex, float>>());
- Tensor<float, 1, DataLayout> mini = tensor.minimum();
+ Tensor<float, 0, DataLayout> mini = tensor.minimum();
- VERIFY_IS_EQUAL(mini(0), reduced(0).second);
+ VERIFY_IS_EQUAL(mini(), reduced(0).second);
array<DenseIndex, 3> reduce_dims;
for (int d = 0; d < 3; ++d) reduce_dims[d] = d;
@@ -123,7 +123,7 @@ static void test_simple_argmax()
tensor = (tensor + tensor.constant(0.5)).log();
tensor(0,0,0,0) = 10.0;
- Tensor<DenseIndex, 1, DataLayout> tensor_argmax(1);
+ Tensor<DenseIndex, 0, DataLayout> tensor_argmax;
tensor_argmax = tensor.argmax();
@@ -144,7 +144,7 @@ static void test_simple_argmin()
tensor = (tensor + tensor.constant(0.5)).log();
tensor(0,0,0,0) = -10.0;
- Tensor<DenseIndex, 1, DataLayout> tensor_argmin(1);
+ Tensor<DenseIndex, 0, DataLayout> tensor_argmin;
tensor_argmin = tensor.argmin();