ONE - On-device Neural Engine
|
#include <GraphPatternMatcher.h>
Public Types | |
using | Predicate = bool(const Operation *) |
Public Member Functions | |
GraphPatternMatcher (Graph *g) | |
std::vector< std::pair< Operation *, Operation * > > | matchEdge (Predicate p1, Predicate p2) |
Match an edge with 2 predicates for ends of the edge. | |
std::vector< std::pair< std::vector< Operation * >, Operation * > > | matchUpBush (Predicate p1, Predicate p2) |
Match a two level tree where the bottommost node has multiple previous nodes. | |
Definition at line 27 of file GraphPatternMatcher.h.
using mir::GraphPatternMatcher::Predicate = bool(const Operation *) |
Definition at line 30 of file GraphPatternMatcher.h.
|
inlineexplicit |
Definition at line 31 of file GraphPatternMatcher.h.
std::vector< std::pair< Operation *, Operation * > > mir::GraphPatternMatcher::matchEdge | ( | GraphPatternMatcher::Predicate | p1, |
GraphPatternMatcher::Predicate | p2 | ||
) |
Match an edge with 2 predicates for ends of the edge.
pattern |
Definition at line 26 of file GraphPatternMatcher.cpp.
References mir::Graph::getNodes().
Referenced by nnc::CombineTransposes::run(), nnc::ConstantFoldTranspose::run(), nnc::SinkRelu::run(), and nnc::SinkTranspose::run().
std::vector< std::pair< std::vector< Operation * >, Operation * > > mir::GraphPatternMatcher::matchUpBush | ( | Predicate | p1, |
Predicate | p2 | ||
) |
Match a two level tree where the bottommost node has multiple previous nodes.
p1 | Predicate for top node |
p2 | Predicate for bottom node |
Definition at line 52 of file GraphPatternMatcher.cpp.
References mir::Graph::getNodes().
Referenced by nnc::SinkRelu::run(), and nnc::SinkTranspose::run().