aboutsummaryrefslogtreecommitdiffstats
path: root/eval/src/tests/instruction/generic_reduce/generic_reduce_test.cpp
diff options
context:
space:
mode:
authorArne Juul <arnej@verizonmedia.com>2021-02-02 15:27:14 +0000
committerArne Juul <arnej@verizonmedia.com>2021-02-02 15:37:25 +0000
commit9b3a2d5fdbc00c304b1da6e7a15c57dcbdab2c8e (patch)
tree94e41b9f2c76b1717db34490167799618e065217 /eval/src/tests/instruction/generic_reduce/generic_reduce_test.cpp
parent941bf25aea1ff089f54b62ec78af5d4f14d2af35 (diff)
followup on GenSpec after review
* avoid changing layouts in-place, call cpy() first * do cells_float() vs cells_double() more equally * minor cosmetic fixes
Diffstat (limited to 'eval/src/tests/instruction/generic_reduce/generic_reduce_test.cpp')
-rw-r--r--eval/src/tests/instruction/generic_reduce/generic_reduce_test.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/eval/src/tests/instruction/generic_reduce/generic_reduce_test.cpp b/eval/src/tests/instruction/generic_reduce/generic_reduce_test.cpp
index 1e9ce85d7e1..56277cf4035 100644
--- a/eval/src/tests/instruction/generic_reduce/generic_reduce_test.cpp
+++ b/eval/src/tests/instruction/generic_reduce/generic_reduce_test.cpp
@@ -20,9 +20,9 @@ using vespalib::make_string_short::fmt;
GenSpec::seq_t N_16ths = [] (size_t i) { return (i + 1.0) / 16.0; };
-GenSpec G() { return GenSpec().cells_float().seq(N_16ths); }
+GenSpec G() { return GenSpec().seq(N_16ths); }
-std::vector<GenSpec> layouts = {
+const std::vector<GenSpec> layouts = {
G(),
G().idx("x", 3),
G().idx("x", 3).idx("y", 5),
@@ -70,7 +70,9 @@ TEST(GenericReduceTest, sparse_reduce_plan_can_be_created) {
void test_generic_reduce_with(const ValueBuilderFactory &factory) {
for (const auto &layout: layouts) {
- for (TensorSpec input : { layout.gen(), layout.cpy().cells_double().gen() }) {
+ for (TensorSpec input : { layout.cpy().cells_float().gen(),
+ layout.cpy().cells_double().gen() })
+ {
SCOPED_TRACE(fmt("tensor type: %s, num_cells: %zu", input.type().c_str(), input.cells().size()));
for (Aggr aggr: {Aggr::SUM, Aggr::AVG, Aggr::MIN, Aggr::MAX}) {
SCOPED_TRACE(fmt("aggregator: %s", AggrNames::name_of(aggr)->c_str()));