diff options
3 files changed, 2 insertions, 18 deletions
diff --git a/searchlib/src/tests/tensor/dense_tensor_store/dense_tensor_store_test.cpp b/searchlib/src/tests/tensor/dense_tensor_store/dense_tensor_store_test.cpp index a3b59909ac8..3385ac5a6bc 100644 --- a/searchlib/src/tests/tensor/dense_tensor_store/dense_tensor_store_test.cpp +++ b/searchlib/src/tests/tensor/dense_tensor_store/dense_tensor_store_test.cpp @@ -15,7 +15,6 @@ using vespalib::eval::SimpleValue; using vespalib::eval::TensorSpec; using vespalib::eval::Value; using vespalib::eval::ValueType; -using vespalib::tensor::MutableDenseTensorView; using EntryRef = DenseTensorStore::EntryRef; @@ -46,8 +45,8 @@ struct Fixture assertTensorView(ref, *expTensor); } void assertTensorView(EntryRef ref, const Value &expTensor) { - MutableDenseTensorView actTensor(store.type()); - store.getTensor(ref, actTensor); + auto cells = store.get_typed_cells(ref); + vespalib::eval::DenseValueView actTensor(store.type(), cells); EXPECT_EQUAL(expTensor, actTensor); } }; diff --git a/searchlib/src/vespa/searchlib/tensor/dense_tensor_store.cpp b/searchlib/src/vespa/searchlib/tensor/dense_tensor_store.cpp index ddbb956838b..aa81f3836a6 100644 --- a/searchlib/src/vespa/searchlib/tensor/dense_tensor_store.cpp +++ b/searchlib/src/vespa/searchlib/tensor/dense_tensor_store.cpp @@ -6,7 +6,6 @@ #include <vespa/vespalib/datastore/datastore.hpp> using vespalib::datastore::Handle; -using vespalib::tensor::MutableDenseTensorView; using vespalib::eval::Value; using vespalib::eval::ValueType; using CellType = vespalib::eval::CellType; @@ -137,18 +136,6 @@ DenseTensorStore::getTensor(EntryRef ref) const return std::make_unique<vespalib::tensor::DenseTensorView>(_type, cells_ref); } -void -DenseTensorStore::getTensor(EntryRef ref, MutableDenseTensorView &tensor) const -{ - if (!ref.valid()) { - vespalib::eval::TypedCells cells_ref(&_emptySpace[0], _type.cell_type(), getNumCells()); - tensor.setCells(cells_ref); - } else { - vespalib::eval::TypedCells cells_ref(getRawBuffer(ref), _type.cell_type(), getNumCells()); - tensor.setCells(cells_ref); - } -} - vespalib::eval::TypedCells DenseTensorStore::get_typed_cells(EntryRef ref) const { diff --git a/searchlib/src/vespa/searchlib/tensor/dense_tensor_store.h b/searchlib/src/vespa/searchlib/tensor/dense_tensor_store.h index 696a325f813..49e8a585fec 100644 --- a/searchlib/src/vespa/searchlib/tensor/dense_tensor_store.h +++ b/searchlib/src/vespa/searchlib/tensor/dense_tensor_store.h @@ -6,7 +6,6 @@ #include <vespa/eval/eval/value_type.h> #include <vespa/eval/eval/typed_cells.h> -namespace vespalib { namespace tensor { class MutableDenseTensorView; }} namespace vespalib::eval { struct Value; } namespace search::tensor { @@ -66,7 +65,6 @@ public: void holdTensor(EntryRef ref) override; EntryRef move(EntryRef ref) override; std::unique_ptr<vespalib::eval::Value> getTensor(EntryRef ref) const; - void getTensor(EntryRef ref, vespalib::tensor::MutableDenseTensorView &tensor) const; vespalib::eval::TypedCells get_typed_cells(EntryRef ref) const; EntryRef setTensor(const vespalib::eval::Value &tensor); // The following method is meant to be used only for unit tests. |