summaryrefslogtreecommitdiffstats
path: root/eval/src/vespa/eval/tensor/tensor_visitor.h
blob: 4002aab6e7e50801066d64dd3d29b4a165a89d38 (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 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

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

namespace vespalib {
namespace tensor {

/**
 * Class for visiting a tensor.  First visit must specify dimensions,
 * remaining visits must specify tensor addresses and values.
 */
class TensorVisitor
{
public:
    virtual ~TensorVisitor() {}
    virtual void visit(const TensorAddress &address, double value) = 0;
};

} // namespace vespalib::tensor
} // namespace vespalib