11 #ifndef TEQ_FUNCTOR_HPP 12 #define TEQ_FUNCTOR_HPP 25 logs::fatalf(
"cannot perform `%s` with no arguments",
26 opcode.
name_.c_str());
30 for (
size_t i = 1, n =
args.size(); i < n; ++i)
35 logs::fatalf(
"cannot perform `%s` with incompatible shapes %s " 50 return new Functor(std::move(other));
84 logs::warn(
"teq::Functor does not allow editing of children");
107 #endif // TEQ_FUNCTOR_HPP std::string to_string(void) const
Return string representation of shape.
Definition: shape.hpp:148
args
Definition: csv_to_png.py:105
Encoding of operation.
Definition: ifunctor.hpp:18
Interface of iOperation-defined operation node.
Definition: ifunctor.hpp:28
const ArgsT & get_children(void) const override
Implementation of iFunctor.
Definition: functor.hpp:76
std::vector< FuncArg > ArgsT
Type of functor arguments.
Definition: funcarg.hpp:101
Functor(Opcode opcode, Shape shape, ArgsT args)
Definition: functor.hpp:88
bool compatible_after(const Shape &other, RankT idx) const
Definition: shape.hpp:136
std::string name_
String representation of operation.
Definition: ifunctor.hpp:21
void update_child(FuncArg arg, size_t index) override
Implementation of iFunctor.
Definition: functor.hpp:82
Opcode opcode_
Operation encoding.
Definition: functor.hpp:96
Functor & operator=(const Functor &other)=delete
Coordinate mapper and tensor pair.
Definition: funcarg.hpp:21
const Shape & shape(void) const override
Implementation of iTensor.
Definition: functor.hpp:58
Shape shape_
Shape info built at construction time according to arguments.
Definition: functor.hpp:99
ArgsT args_
Tensor arguments (and children)
Definition: functor.hpp:102
std::string to_string(void) const override
Implementation of iTensor.
Definition: functor.hpp:64
NElemT index(Shape shape, CoordT coord)
Functor of the graph mapping to operators specified by opcode argument.
Definition: functor.hpp:18
Opcode get_opcode(void) const override
Implementation of iFunctor.
Definition: functor.hpp:70