diff options
author | Arne H Juul <arnej27959@users.noreply.github.com> | 2020-10-14 15:50:32 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-14 15:50:32 +0200 |
commit | 5b94cf7c6c5df1284d42c84b0ca8b8b3f5f1eba4 (patch) | |
tree | c0c50bae040cab36316a2ae81e15345d0508c2c0 /searchlib | |
parent | 1ea40c61012e36f4cecf93194d3e15ef26a4b642 (diff) | |
parent | 1f5a099c4b2f26d779501ed0b4758175e1a01457 (diff) |
Merge pull request #14852 from vespa-engine/arnej/some-eval-additions
Arnej/some eval additions
Diffstat (limited to 'searchlib')
4 files changed, 8 insertions, 8 deletions
diff --git a/searchlib/src/vespa/searchlib/queryeval/nearest_neighbor_blueprint.cpp b/searchlib/src/vespa/searchlib/queryeval/nearest_neighbor_blueprint.cpp index 877ed6b5094..e99e14c8d6b 100644 --- a/searchlib/src/vespa/searchlib/queryeval/nearest_neighbor_blueprint.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/nearest_neighbor_blueprint.cpp @@ -24,7 +24,7 @@ template<typename LCT, typename RCT> void convert_cells(std::unique_ptr<DenseTensorView> &original, vespalib::eval::ValueType want_type) { - auto old_cells = original->cellsRef().typify<LCT>(); + auto old_cells = original->cells().typify<LCT>(); std::vector<RCT> new_cells; new_cells.reserve(old_cells.size()); for (LCT value : old_cells) { @@ -66,7 +66,7 @@ NearestNeighborBlueprint::NearestNeighborBlueprint(const queryeval::FieldSpec& f _found_hits(), _global_filter(GlobalFilter::create()) { - auto lct = _query_tensor->cellsRef().type; + auto lct = _query_tensor->cells().type; auto rct = _attr_tensor.getTensorType().cell_type(); using MyTypify = vespalib::eval::TypifyCellType; auto fixup_fun = vespalib::typify_invoke<2,MyTypify,ConvertCellsSelector>(lct, rct); @@ -124,7 +124,7 @@ NearestNeighborBlueprint::perform_top_k() auto rhs_type = _attr_tensor.getTensorType(); // different cell types should be converted already if (lhs_type == rhs_type) { - auto lhs = _query_tensor->cellsRef(); + auto lhs = _query_tensor->cells(); uint32_t k = _target_num_hits; if (_global_filter->has_filter()) { auto filter = _global_filter->filter(); diff --git a/searchlib/src/vespa/searchlib/queryeval/nearest_neighbor_iterator.cpp b/searchlib/src/vespa/searchlib/queryeval/nearest_neighbor_iterator.cpp index cf4e8ae2f6a..3012de7563b 100644 --- a/searchlib/src/vespa/searchlib/queryeval/nearest_neighbor_iterator.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/nearest_neighbor_iterator.cpp @@ -37,7 +37,7 @@ public: NearestNeighborImpl(Params params_in) : NearestNeighborIterator(params_in), - _lhs(params().queryTensor.cellsRef()), + _lhs(params().queryTensor.cells()), _fieldTensor(params().tensorAttribute.getTensorType()), _lastScore(0.0) { @@ -77,7 +77,7 @@ public: private: double computeDistance(uint32_t docId, double limit) { params().tensorAttribute.extract_dense_view(docId, _fieldTensor); - auto rhs = _fieldTensor.cellsRef(); + auto rhs = _fieldTensor.cells(); return params().distanceFunction->calc_with_limit(_lhs, rhs, limit); } diff --git a/searchlib/src/vespa/searchlib/tensor/dense_tensor_attribute.cpp b/searchlib/src/vespa/searchlib/tensor/dense_tensor_attribute.cpp index 0a34c18bae9..81c8df982b1 100644 --- a/searchlib/src/vespa/searchlib/tensor/dense_tensor_attribute.cpp +++ b/searchlib/src/vespa/searchlib/tensor/dense_tensor_attribute.cpp @@ -149,7 +149,7 @@ DenseTensorAttribute::prepare_set_tensor(DocId docid, const Tensor& tensor) cons if (_index) { const auto* view = dynamic_cast<const DenseTensorView*>(&tensor); assert(view); - return _index->prepare_add_document(docid, view->cellsRef(), getGenerationHandler().takeGuard()); + return _index->prepare_add_document(docid, view->cells(), getGenerationHandler().takeGuard()); } return std::unique_ptr<PrepareResult>(); } diff --git a/searchlib/src/vespa/searchlib/tensor/dense_tensor_store.cpp b/searchlib/src/vespa/searchlib/tensor/dense_tensor_store.cpp index 7a020d33d5c..e250a19214c 100644 --- a/searchlib/src/vespa/searchlib/tensor/dense_tensor_store.cpp +++ b/searchlib/src/vespa/searchlib/tensor/dense_tensor_store.cpp @@ -166,11 +166,11 @@ template <class TensorType> TensorStore::EntryRef DenseTensorStore::setDenseTensor(const TensorType &tensor) { - size_t numCells = tensor.cellsRef().size; + size_t numCells = tensor.cells().size; assert(numCells == getNumCells()); assert(tensor.type() == _type); auto raw = allocRawBuffer(); - memcpy(raw.data, tensor.cellsRef().data, getBufSize()); + memcpy(raw.data, tensor.cells().data, getBufSize()); return raw.ref; } |