"verl/models/transformers/flash_attention_utils.py" did not exist on "f92481f0d8a32874630ff6a91ed5ad84fae1d798"
builtin.hpp 1.06 KB
Newer Older
Paul's avatar
Paul committed
1
2
3
#ifndef RTG_GUARD_BUILTIN_HPP
#define RTG_GUARD_BUILTIN_HPP

Paul's avatar
Paul committed
4
#include <rtg/operation.hpp>
Paul's avatar
Paul committed
5
#include <rtg/errors.hpp>
Paul's avatar
Paul committed
6

Paul's avatar
Paul committed
7
8
9
10
namespace rtg {

namespace builtin {

Paul's avatar
Paul committed
11
12
struct literal
{
Paul's avatar
Paul committed
13
    std::string name() const { return "@literal"; }
Paul's avatar
Paul committed
14
    shape compute_shape(std::vector<shape>) const { RTG_THROW("builtin"); }
Paul's avatar
Paul committed
15
    argument compute(shape, std::vector<argument>) const { RTG_THROW("builtin"); }
Paul's avatar
Paul committed
16
17
};

Paul's avatar
Paul committed
18
19
20
21
22
23
24
25
struct outline
{
    shape s;
    std::string name() const { return "@outline"; }
    shape compute_shape(std::vector<shape>) const { RTG_THROW("builtin"); }
    argument compute(shape, std::vector<argument>) const { RTG_THROW("builtin"); }
};

Paul's avatar
Paul committed
26
27
28
struct param
{
    std::string parameter;
Paul's avatar
Paul committed
29
    std::string name() const { return "@param"; }
Paul's avatar
Paul committed
30
    shape compute_shape(std::vector<shape>) const { RTG_THROW("builtin"); }
Paul's avatar
Paul committed
31
    argument compute(shape, std::vector<argument>) const { RTG_THROW("builtin"); }
Paul's avatar
Paul committed
32
    friend std::ostream& operator<<(std::ostream& os, const param& op)
Paul's avatar
Paul committed
33
    {
Paul's avatar
Paul committed
34
        os << op.name() << ":" << op.parameter;
Paul's avatar
Paul committed
35
36
        return os;
    }
Paul's avatar
Paul committed
37
};
Paul's avatar
Paul committed
38

Paul's avatar
Paul committed
39
} // namespace builtin
Paul's avatar
Paul committed
40
41
42
43

} // namespace rtg

#endif