aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/vespa/searchlib/features/dense_tensor_attribute_executor.h
blob: 8b72ca3f559e2901abe5ade63af2b89b4835d692 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include <vespa/searchlib/fef/featureexecutor.h>
#include <vespa/eval/eval/value.h>
#include "mutable_dense_value_view.h"

namespace search::tensor { class ITensorAttribute; }
namespace search::features {

/**
 * Executor for extracting dense tensors from an underlying dense tensor attribute
 * without copying cells data.
 */
class DenseTensorAttributeExecutor : public fef::FeatureExecutor
{
private:
    const search::tensor::ITensorAttribute& _attribute;
    mutable_value::MutableDenseValueView _tensorView;

public:
    DenseTensorAttributeExecutor(const search::tensor::ITensorAttribute& attribute);
    void execute(uint32_t docId) override;
};

}