aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/vespa/searchlib/tensor/tensor_store_saver.h
diff options
context:
space:
mode:
authorGeir Storli <geirst@yahooinc.com>2022-10-09 20:12:34 +0200
committerGitHub <noreply@github.com>2022-10-09 20:12:34 +0200
commit240a62de8a9b3c93fb9f7031f5e204264d414817 (patch)
tree1f5e0bb204f8a98d7bf8fdf0da48472de27a3ab8 /searchlib/src/vespa/searchlib/tensor/tensor_store_saver.h
parent14e1b2febd40c3fa89d09b64569b4634f5594acc (diff)
parenta45d929b88b17c9de0d53d4c6fc3b25815bbe233 (diff)
Merge pull request #24367 from vespa-engine/toregge/share-code-for-loading-and-saving-tensor-attributev8.65.41
Share code for loading and saving tensor attribute between
Diffstat (limited to 'searchlib/src/vespa/searchlib/tensor/tensor_store_saver.h')
-rw-r--r--searchlib/src/vespa/searchlib/tensor/tensor_store_saver.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/searchlib/src/vespa/searchlib/tensor/tensor_store_saver.h b/searchlib/src/vespa/searchlib/tensor/tensor_store_saver.h
new file mode 100644
index 00000000000..a4bf6e07519
--- /dev/null
+++ b/searchlib/src/vespa/searchlib/tensor/tensor_store_saver.h
@@ -0,0 +1,33 @@
+// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+
+#pragma once
+
+#include <vespa/searchlib/attribute/attributesaver.h>
+#include "tensor_attribute.h"
+
+namespace search::tensor {
+
+/*
+ * Class for saving a tensor attribute.
+ */
+class TensorStoreSaver : public AttributeSaver
+{
+public:
+ using RefCopyVector = TensorAttribute::RefCopyVector;
+private:
+ using GenerationHandler = vespalib::GenerationHandler;
+
+ RefCopyVector _refs;
+ const TensorStore& _tensorStore;
+
+ bool onSave(IAttributeSaveTarget &saveTarget) override;
+public:
+ TensorStoreSaver(GenerationHandler::Guard &&guard,
+ const attribute::AttributeHeader &header,
+ RefCopyVector &&refs,
+ const TensorStore &tensorStore);
+
+ virtual ~TensorStoreSaver();
+};
+
+} // namespace search::tensor