tvm
|
A wrapper around ExprVisitor which traverses the Dataflow Normal AST. More...
#include <expr_functor.h>
Public Member Functions | |
MixedModeVisitor (int visit_limit=1) | |
The constructor of MixedModeVisitor. More... | |
void | VisitExpr (const Expr &expr) final |
VisitExpr is finalized to preserve call expansion of dataflow regions. More... | |
void | VisitExpr_ (const CallNode *op) override |
void | VisitExpr_ (const TupleNode *op) override |
void | VisitExpr_ (const TupleGetItemNode *op) override |
void | VisitExpr_ (const VarNode *op) override |
void | VisitExpr_ (const GlobalVarNode *op) override |
void | VisitExpr_ (const ConstantNode *op) override |
void | VisitExpr_ (const TupleNode *op) override |
void | VisitExpr_ (const FunctionNode *op) override |
void | VisitExpr_ (const CallNode *op) override |
void | VisitExpr_ (const LetNode *op) override |
void | VisitExpr_ (const IfNode *op) override |
void | VisitExpr_ (const OpNode *op) override |
void | VisitExpr_ (const TupleGetItemNode *op) override |
void | VisitExpr_ (const RefCreateNode *op) override |
void | VisitExpr_ (const RefReadNode *op) override |
void | VisitExpr_ (const RefWriteNode *op) override |
void | VisitExpr_ (const ConstructorNode *op) override |
void | VisitExpr_ (const MatchNode *op) override |
Public Member Functions inherited from tvm::relay::ExprVisitor | |
void | VisitExpr (const Expr &expr) override |
void | VisitExpr_ (const VarNode *op) override |
void | VisitExpr_ (const GlobalVarNode *op) override |
void | VisitExpr_ (const ConstantNode *op) override |
void | VisitExpr_ (const TupleNode *op) override |
void | VisitExpr_ (const FunctionNode *op) override |
void | VisitExpr_ (const CallNode *op) override |
void | VisitExpr_ (const LetNode *op) override |
void | VisitExpr_ (const IfNode *op) override |
void | VisitExpr_ (const OpNode *op) override |
void | VisitExpr_ (const TupleGetItemNode *op) override |
void | VisitExpr_ (const RefCreateNode *op) override |
void | VisitExpr_ (const RefReadNode *op) override |
void | VisitExpr_ (const RefWriteNode *op) override |
void | VisitExpr_ (const ConstructorNode *op) override |
void | VisitExpr_ (const MatchNode *op) override |
virtual void | VisitType (const Type &t) |
virtual void | VisitClause (const Clause &c) |
virtual void | VisitPattern (const Pattern &c) |
virtual void | VisitSpan (const Span &span) |
Protected Member Functions | |
virtual void | VisitLeaf (const Expr &expr) |
A function to apply when reaching a leaf of the graph non-recursively. More... | |
virtual bool | CheckVisited (const Expr &expr) |
A function to determine if an expression has already been visited or needs to be re-visited. More... | |
Protected Attributes | |
size_t | visit_limit_ |
The max number of times to visit a node. More... | |
Protected Attributes inherited from tvm::relay::ExprVisitor | |
std::unordered_map< const Object *, size_t > | visit_counter_ |
A wrapper around ExprVisitor which traverses the Dataflow Normal AST.
MixedModeVisitor treats Expr as dataflow graph, and visits in post-DFS order
MixedModeVisitor provides the same recursive API as ExprVisitor, and uses recursion to traverse most forms of the IR, but under the hood it expands nested dataflow regions of the graph and processes them iteratively to prevent stack overflows
|
explicit |
The constructor of MixedModeVisitor.
visit_limit | The number of times to allow visitation to a node. Usually 1, ocassionally higher (i.e., 2 for dead code elimiation), limited to 10 as a sanity check. |
|
protectedvirtual |
A function to determine if an expression has already been visited or needs to be re-visited.
|
final |
VisitExpr is finalized to preserve call expansion of dataflow regions.
|
override |
|
override |
|
override |
|
override |
|
override |
|
override |
|
override |
|
override |
|
override |
|
override |
|
override |
|
override |
|
override |
|
override |
|
override |
|
override |
|
override |
|
override |
|
protectedvirtual |
A function to apply when reaching a leaf of the graph non-recursively.
|
protected |
The max number of times to visit a node.