diff options
author | Arne Juul <arnej@verizonmedia.com> | 2020-10-13 14:11:28 +0000 |
---|---|---|
committer | Arne Juul <arnej@verizonmedia.com> | 2020-10-15 08:18:59 +0000 |
commit | 08393e9e14635f1c6a6c84650c25023a0db7ed0b (patch) | |
tree | 48aae1605140fc6ff7d571084f345d33a3189c62 /searchsummary | |
parent | 61eaea251e8cacd320ac10754ffd1513d8638043 (diff) |
handle both engine- and factory-based tensors
* use EngineOrFactory::get() instead of DefaultTensorEngine::ref()
* avoid direct use of DenseTensorView etc where possible
* use eval::Value instead of tensor::Tensor where possible
Diffstat (limited to 'searchsummary')
-rw-r--r-- | searchsummary/src/vespa/searchsummary/docsummary/attributedfw.cpp | 8 | ||||
-rw-r--r-- | searchsummary/src/vespa/searchsummary/docsummary/summaryfieldconverter.cpp | 4 |
2 files changed, 7 insertions, 5 deletions
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/attributedfw.cpp b/searchsummary/src/vespa/searchsummary/docsummary/attributedfw.cpp index 05ba12ddff9..dd1b6f95618 100644 --- a/searchsummary/src/vespa/searchsummary/docsummary/attributedfw.cpp +++ b/searchsummary/src/vespa/searchsummary/docsummary/attributedfw.cpp @@ -3,8 +3,8 @@ #include "attributedfw.h" #include "docsumstate.h" #include "docsumwriter.h" -#include <vespa/eval/tensor/serialization/typed_binary_format.h> -#include <vespa/eval/tensor/tensor.h> +#include <vespa/eval/eval/engine_or_factory.h> +#include <vespa/eval/eval/value.h> #include <vespa/searchcommon/attribute/iattributecontext.h> #include <vespa/searchlib/attribute/iattributemanager.h> #include <vespa/searchlib/attribute/integerbase.h> @@ -25,6 +25,8 @@ using search::attribute::IAttributeVector; using vespalib::Memory; using vespalib::slime::Cursor; using vespalib::slime::Inserter; +using vespalib::eval::EngineOrFactory; +using vespalib::eval::Value; namespace search::docsummary { @@ -104,7 +106,7 @@ SingleAttrDFW::insertField(uint32_t docid, GetDocsumsState * state, ResType type const auto tensor = tv->getTensor(docid); if (tensor) { vespalib::nbostream str; - vespalib::tensor::TypedBinaryFormat::serialize(str, *tensor); + EngineOrFactory::get().encode(*tensor, str); target.insertData(vespalib::Memory(str.peek(), str.size())); } } diff --git a/searchsummary/src/vespa/searchsummary/docsummary/summaryfieldconverter.cpp b/searchsummary/src/vespa/searchsummary/docsummary/summaryfieldconverter.cpp index ada14bf17f5..604e1b4c413 100644 --- a/searchsummary/src/vespa/searchsummary/docsummary/summaryfieldconverter.cpp +++ b/searchsummary/src/vespa/searchsummary/docsummary/summaryfieldconverter.cpp @@ -31,7 +31,7 @@ #include <vespa/vespalib/stllike/asciistream.h> #include <vespa/vespalib/util/stringfmt.h> #include <vespa/vespalib/data/slime/slime.h> -#include <vespa/eval/tensor/serialization/typed_binary_format.h> +#include <vespa/eval/eval/engine_or_factory.h> #include <vespa/vespalib/objects/nbostream.h> #include <vespa/searchlib/util/slime_output_raw_buf_adapter.h> #include <vespa/vespalib/util/exceptions.h> @@ -510,7 +510,7 @@ private: const auto &tensor = value.getAsTensorPtr(); vespalib::nbostream s; if (tensor) { - vespalib::tensor::TypedBinaryFormat::serialize(s, *tensor); + vespalib::eval::EngineOrFactory::get().encode(*tensor, s); } _inserter.insertData(vespalib::Memory(s.peek(), s.size())); } |