aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/vespa/searchlib/features/dense_tensor_attribute_executor.cpp
blob: fec51109f880fbccd854263933a57978cd572449 (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
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#include "dense_tensor_attribute_executor.h"
#include <vespa/searchlib/tensor/i_tensor_attribute.h>

using search::tensor::ITensorAttribute;

namespace search::features {

DenseTensorAttributeExecutor::
DenseTensorAttributeExecutor(const ITensorAttribute& attribute)
    : _attribute(attribute),
      _tensorView(_attribute.getTensorType())
{
}

void
DenseTensorAttributeExecutor::execute(uint32_t docId)
{
    _tensorView.setCells(_attribute.extract_cells_ref(docId));
    outputs().set_object(0, _tensorView);
}

}