blob: f2fc439bb9c580b17a26f8c19a17a825bf2414a8 (
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
|
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include <vespa/eval/eval/tensor_function.h>
namespace vespalib::eval {
/**
* Tensor function for a dot product between two sparse tensors.
*/
class SparseDotProductFunction : public tensor_function::Op2
{
public:
SparseDotProductFunction(const TensorFunction &lhs_in,
const TensorFunction &rhs_in);
InterpretedFunction::Instruction compile_self(const CTFContext &ctx) const override;
bool result_is_mutable() const override { return true; }
static bool compatible_types(const ValueType &res, const ValueType &lhs, const ValueType &rhs);
static const TensorFunction &optimize(const TensorFunction &expr, Stash &stash);
};
} // namespace
|