aboutsummaryrefslogtreecommitdiffstats
path: root/eval/src/vespa/eval/eval/value_cache/constant_tensor_loader.h
blob: bb02af55eebce6b0cd6b94846f23522f85e9e966 (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 Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include "constant_value.h"
#include <vespa/vespalib/stllike/string.h>

namespace vespalib::eval {

struct ValueBuilderFactory;

/**
 * A ConstantValueFactory that will load constant tensor values from
 * file. The file is expected to be in json format with the same
 * structure used when feeding.
 **/
class ConstantTensorLoader : public ConstantValueFactory
{
private:
    const ValueBuilderFactory &_factory;
public:
    ConstantTensorLoader(const ValueBuilderFactory &factory) : _factory(factory) {}
    ~ConstantTensorLoader();
    ConstantValue::UP create(const vespalib::string &path, const vespalib::string &type) const override;
};

}