summaryrefslogtreecommitdiffstats
path: root/eval/src/vespa/eval/tensor/sparse/sparse_tensor_apply.h
blob: ec6edf2d8471a6c4d4efd52964a0a8aeecc7d37f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

namespace vespalib::tensor {
    class Tensor;
    class SparseTensor;
}

namespace vespalib::tensor::sparse {

/**
 * Create new tensor using all combinations of input tensor cells with matching
 * labels for common dimensions, using func to calculate new cell value
 * based on the cell values in the input tensors.
 */
template <typename Function>
std::unique_ptr<Tensor>
apply(const SparseTensor &lhs, const SparseTensor &rhs, Function &&func);

}