28 assert(node !=
nullptr);
30 for (uint32_t arity = 0; arity < node->
arity(); ++arity)
82 if (_rule->
infer(node, shape))
84 node->
annot(std::make_unique<ShapeAnnotation>(shape));
99 return node->
annot<ShapeAnnotation>()->shape();
const T * annot(void) const
Retrieve a stored annotation of type T.
Logical unit of computation.
virtual Node * arg(uint32_t N) const =0
Access N-th argument node.
virtual uint32_t arity(void) const =0
Return the number of arguments.
virtual const Dialect * dialect(void) const =0
Return "Dialect" identifier that this node belongs to.
std::vector< loco::Node * > postorder_traversal(const std::vector< loco::Node * > &roots)
Generate postorder traversal sequence starting from "roots".
bool shape_known(const Node *node)
std::vector< Node * > output_nodes(Graph *)
Extensible Node Metadata.
static NodeShape get(const Node *)
static void erase(Node *)
static bool known(const Node *)
virtual bool support(const API &api) const
Check whether a given API is available or not.
virtual bool infer(const Node *, NodeShape &) const =0
Infer node's shape.
virtual bool recognize(const Dialect *) const =0
Return true if this rule recognizes a given dialect.