summaryrefslogtreecommitdiffstats
path: root/eval
diff options
context:
space:
mode:
authorHåvard Pettersen <havardpe@oath.com>2019-05-03 13:33:35 +0000
committerHåvard Pettersen <havardpe@oath.com>2019-05-03 13:33:35 +0000
commit87a77d6868390c7b76689468762915fac000fb2d (patch)
tree78df3bd3a41c603efc81c66ba22ceec790ff7b34 /eval
parenta3edaae250c407de5445823851b4182b9e2e4d5b (diff)
make sure tensor spec has appropriate type
adds runtime support for input tensors with float cells in eval fixture used for testing.
Diffstat (limited to 'eval')
-rw-r--r--eval/src/vespa/eval/eval/tensor_spec.h1
-rw-r--r--eval/src/vespa/eval/eval/test/eval_fixture.h1
2 files changed, 2 insertions, 0 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;
}