blob: a9d98b410c0965299230178978999f41d2f13ce7 (
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
36
37
38
39
|
// 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>
#include <vespa/eval/eval/operation.h>
namespace vespalib::eval {
/**
* Tensor function for simple expanding join operations on dense
* tensors. An expanding operation is a join between tensors resulting
* in a larger tensor where the input tensors have no matching
* dimensions (trivial dimensions are ignored). A simple expanding
* operation is an expanding operation where all the dimensions of one
* input is nested inside all the dimensions from the other input
* within the result (trivial dimensions are again ignored).
**/
class DenseSimpleExpandFunction : public tensor_function::Join
{
using Super = tensor_function::Join;
public:
enum class Inner : uint8_t { LHS, RHS };
using join_fun_t = operation::op2_t;
private:
Inner _inner;
public:
DenseSimpleExpandFunction(const ValueType &result_type,
const TensorFunction &lhs,
const TensorFunction &rhs,
join_fun_t function_in,
Inner inner_in);
~DenseSimpleExpandFunction() override;
Inner inner() const { return _inner; }
InterpretedFunction::Instruction compile_self(const CTFContext &ctx) const override;
static const TensorFunction &optimize(const TensorFunction &expr, Stash &stash);
};
} // namespace
|