summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHÃ¥vard Pettersen <havardpe@oath.com>2019-05-03 16:16:16 +0200
committerGitHub <noreply@github.com>2019-05-03 16:16:16 +0200
commit4ba49868dc36b446272fc66c2d3f853c5d399034 (patch)
tree4d3107533085501a85ce953b7f77188b3af7ec17
parent93f18a00c63c6cfc8d2e1aebf2b5f7b67b91224b (diff)
parent68a1ef9c48792261e9f8b77b468edf6648ab20ec (diff)
Merge pull request #9275 from vespa-engine/havardpe/make-more-robust
Havardpe/make more robust
-rw-r--r--eval/src/vespa/eval/eval/tensor_spec.h1
-rw-r--r--eval/src/vespa/eval/eval/test/eval_fixture.h1
-rw-r--r--eval/src/vespa/eval/tensor/default_tensor_engine.cpp3
3 files changed, 4 insertions, 1 deletions
diff --git a/eval/src/vespa/eval/eval/tensor_spec.h b/eval/src/vespa/eval/eval/tensor_spec.h
index 25af4c7a93c..32dc1c82fcb 100644
--- a/eval/src/vespa/eval/eval/tensor_spec.h
+++ b/eval/src/vespa/eval/eval/tensor_spec.h
@@ -73,6 +73,7 @@ public:
}
return *this;
}
+ void override_type(const vespalib::string &new_type) { _type = new_type; }
const vespalib::string &type() const { return _type; }
const Cells &cells() const { return _cells; }
vespalib::string to_string() const;
diff --git a/eval/src/vespa/eval/eval/test/eval_fixture.h b/eval/src/vespa/eval/eval/test/eval_fixture.h
index e20d435f608..8c7d15e7416 100644
--- a/eval/src/vespa/eval/eval/test/eval_fixture.h
+++ b/eval/src/vespa/eval/eval/test/eval_fixture.h
@@ -29,6 +29,7 @@ public:
std::map<vespalib::string,Param> map;
ParamRepo() : map() {}
ParamRepo &add(const vespalib::string &name, TensorSpec value_in, const vespalib::string &type_in, bool is_mutable_in) {
+ value_in.override_type(type_in);
map.insert_or_assign(name, Param(std::move(value_in), type_in, is_mutable_in));
return *this;
}
diff --git a/eval/src/vespa/eval/tensor/default_tensor_engine.cpp b/eval/src/vespa/eval/tensor/default_tensor_engine.cpp
index 263d77e5d1e..c92d63851b5 100644
--- a/eval/src/vespa/eval/tensor/default_tensor_engine.cpp
+++ b/eval/src/vespa/eval/tensor/default_tensor_engine.cpp
@@ -329,7 +329,8 @@ DefaultTensorEngine::reduce(const Value &a, Aggr aggr, const std::vector<vespali
size_t vector_size(const ValueType &type, const vespalib::string &dimension) {
if (type.is_double()) {
return 1;
- } else if ((type.dimensions().size() == 1) &&
+ } else if ((type.cell_type() == ValueType::CellType::DOUBLE) &&
+ (type.dimensions().size() == 1) &&
(type.dimensions()[0].is_indexed()) &&
(type.dimensions()[0].name == dimension))
{