aboutsummaryrefslogtreecommitdiffstats
path: root/eval/src/tests/instruction/generic_concat
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_concat
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_concat')
-rw-r--r--eval/src/tests/instruction/generic_concat/generic_concat_test.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/eval/src/tests/instruction/generic_concat/generic_concat_test.cpp b/eval/src/tests/instruction/generic_concat/generic_concat_test.cpp
index 88bf7f26b11..2fe49a12a61 100644
--- a/eval/src/tests/instruction/generic_concat/generic_concat_test.cpp
+++ b/eval/src/tests/instruction/generic_concat/generic_concat_test.cpp
@@ -18,11 +18,11 @@ using namespace vespalib::eval::test;
using vespalib::make_string_short::fmt;
-GenSpec G() { return GenSpec().cells_float(); }
+GenSpec G() { return GenSpec(); }
GenSpec::seq_t N_16ths = [] (size_t i) { return (i + 1.0) / 16.0; };
-std::vector<GenSpec> concat_layouts = {
+const std::vector<GenSpec> concat_layouts = {
G(), G(),
G(), G().idx("y", 5),
G().idx("y", 5), G(),
@@ -76,10 +76,14 @@ TensorSpec perform_generic_concat(const TensorSpec &a, const TensorSpec &b,
void test_generic_concat_with(const ValueBuilderFactory &factory) {
ASSERT_TRUE((concat_layouts.size() % 2) == 0);
for (size_t i = 0; i < concat_layouts.size(); i += 2) {
- const auto &l = concat_layouts[i];
- const auto &r = concat_layouts[i+1].seq(N_16ths);
- for (TensorSpec lhs : { l.gen(), l.cpy().cells_double().gen() }) {
- for (TensorSpec rhs : { r.gen(), r.cpy().cells_double().gen() }) {
+ const auto l = concat_layouts[i];
+ const auto r = concat_layouts[i+1].cpy().seq(N_16ths);
+ for (TensorSpec lhs : { l.cpy().cells_float().gen(),
+ l.cpy().cells_double().gen() })
+ {
+ for (TensorSpec rhs : { r.cpy().cells_float().gen(),
+ r.cpy().cells_double().gen() })
+ {
SCOPED_TRACE(fmt("\n===\nin LHS: %s\nin RHS: %s\n===\n", lhs.to_string().c_str(), rhs.to_string().c_str()));
auto actual = perform_generic_concat(lhs, rhs, "y", factory);
auto expect = ReferenceOperations::concat(lhs, rhs, "y");