MimIR
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
tensor.h
Go to the documentation of this file.
1#pragma once
2
3#include <mim/world.h>
4
6
7namespace mim::plug::tensor {
8
9inline const Def* op_get(const Def* T, const Def* r, const Def* s, const Def* arr, const Def* index) {
10 auto& w = arr->world();
11 auto f = w.annex<tensor::get>();
12 f = w.app(f, {T, r, s});
13 f = w.app(f, {arr, index});
14 return f;
15}
16
17inline const Def* op_set(const Def* T, const Def* r, const Def* s, const Def* arr, const Def* index, const Def* x) {
18 auto& w = arr->world();
19 auto f = w.app(w.annex<tensor::set>(), {T, r, s});
20 f = w.app(f, {arr, index, x});
21 return f;
22}
23
24} // namespace mim::plug::tensor
Base class for all Defs.
Definition def.h:246
World & world() const noexcept
Definition def.cpp:444
The tensor Plugin
Definition fuse.h:5
const Def * op_set(const Def *T, const Def *r, const Def *s, const Def *arr, const Def *index, const Def *x)
Definition tensor.h:17
const Def * op_get(const Def *T, const Def *r, const Def *s, const Def *arr, const Def *index)
Definition tensor.h:9