summaryrefslogtreecommitdiffstats
path: root/eval
diff options
context:
space:
mode:
authorHåvard Pettersen <havardpe@oath.com>2020-09-08 09:49:19 +0000
committerHåvard Pettersen <havardpe@oath.com>2020-09-08 09:49:19 +0000
commitc1cd2b3e3638f9044d26644a9edd7f30205f2829 (patch)
tree78427634f427085301b9523f9f3c0ffe9e2babb2 /eval
parentf992e3b356b9cac8d99f7eb5a00562b2755fa285 (diff)
rename set tracking the bound size of all unknown input dimensions
Diffstat (limited to 'eval')
-rw-r--r--eval/src/vespa/eval/tensor/dense/onnx_wrapper.cpp16
-rw-r--r--eval/src/vespa/eval/tensor/dense/onnx_wrapper.h4
2 files changed, 10 insertions, 10 deletions
diff --git a/eval/src/vespa/eval/tensor/dense/onnx_wrapper.cpp b/eval/src/vespa/eval/tensor/dense/onnx_wrapper.cpp
index 0e545bf95c3..b581ce787e3 100644
--- a/eval/src/vespa/eval/tensor/dense/onnx_wrapper.cpp
+++ b/eval/src/vespa/eval/tensor/dense/onnx_wrapper.cpp
@@ -257,7 +257,7 @@ Onnx::WirePlanner::bind_input_type(const eval::ValueType &vespa_in, const Tensor
return false;
}
} else {
- _unknown_sizes.insert(type.dimensions()[i].size);
+ _bound_unknown_sizes.insert(type.dimensions()[i].size);
if (dimensions[i].is_symbolic()) {
auto &bound_size = _symbolic_sizes[dimensions[i].name];
if (bound_size == 0) {
@@ -287,13 +287,13 @@ Onnx::WirePlanner::make_output_type(const TensorInfo &onnx_out) const
}
}
// if the output dimension is still unknown, but all unknown
- // input dimensions have the same size, we use that size as a
- // guess for the size of the unknown output dimension as
- // well. (typical scenario would be batch dimension not tagged
- // as having the same symbolic size across input and output
- // values).
- if ((dim_size == 0) && (_unknown_sizes.size() == 1)) {
- dim_size = *_unknown_sizes.begin();
+ // input dimensions have been bound to the same size, we use
+ // that size as a guess for the size of the unknown output
+ // dimension as well. (typical scenario would be batch
+ // dimension not tagged as having the same symbolic size
+ // across input and output values).
+ if ((dim_size == 0) && (_bound_unknown_sizes.size() == 1)) {
+ dim_size = *_bound_unknown_sizes.begin();
}
if ((dim_size == 0) || (dim_list.size() > 9)) {
return ValueType::error_type();
diff --git a/eval/src/vespa/eval/tensor/dense/onnx_wrapper.h b/eval/src/vespa/eval/tensor/dense/onnx_wrapper.h
index a059f2e2494..9b79e28884e 100644
--- a/eval/src/vespa/eval/tensor/dense/onnx_wrapper.h
+++ b/eval/src/vespa/eval/tensor/dense/onnx_wrapper.h
@@ -84,9 +84,9 @@ public:
private:
std::map<vespalib::string,eval::ValueType> _input_types;
std::map<vespalib::string,size_t> _symbolic_sizes;
- std::set<size_t> _unknown_sizes;
+ std::set<size_t> _bound_unknown_sizes;
public:
- WirePlanner() : _input_types(), _symbolic_sizes(), _unknown_sizes() {}
+ WirePlanner() : _input_types(), _symbolic_sizes(), _bound_unknown_sizes() {}
~WirePlanner();
bool bind_input_type(const eval::ValueType &vespa_in, const TensorInfo &onnx_in);
eval::ValueType make_output_type(const TensorInfo &onnx_out) const;