blob: 0e33958879ff0fcbcd97c934b8aab43ce2ffa3a5 (
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
28
29
30
31
32
33
34
35
|
// 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/value_type.h>
#include <vespa/eval/eval/tensor_function.h>
namespace vespalib::eval {
/**
* Tensor function for joining a general tensor with a number
*/
class JoinWithNumberFunction : public tensor_function::Op2
{
public:
enum class Primary : uint8_t { LHS, RHS };
private:
using Super = tensor_function::Op2;
Primary _primary;
tensor_function::join_fun_t _function;
public:
JoinWithNumberFunction(const tensor_function::Join &original_join, bool number_on_left);
~JoinWithNumberFunction();
Primary primary() const { return _primary; }
bool primary_is_mutable() const;
bool result_is_mutable() const override { return true; }
InterpretedFunction::Instruction compile_self(const CTFContext &ctx) const override;
void visit_self(vespalib::ObjectVisitor &visitor) const override;
static const TensorFunction &optimize(const TensorFunction &expr, Stash &stash);
};
} // namespace vespalib::eval
|