aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/vespa/searchlib/features/dense_tensor_attribute_executor.cpp
blob: 492d4cd4e4f3743589428df56f5e3aed9144fb5c (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 Vespa.ai. 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);
}

}