tvm
Public Member Functions | List of all members
tvm::relay::ExprRewriter Class Reference

A non-iterating Expression Rewriter. More...

#include <expr_functor.h>

Collaboration diagram for tvm::relay::ExprRewriter:

Public Member Functions

virtual ~ExprRewriter ()
 virtual destructor More...
 
Expr operator() (const Expr &pre, const Expr &post)
 Same as call. More...
 
virtual Expr Rewrite (const Expr &pre, const Expr &post)
 The functor call. More...
 
virtual Expr Rewrite_ (const VarNode *pre, const Expr &post)
 
virtual Expr Rewrite_ (const GlobalVarNode *pre, const Expr &post)
 
virtual Expr Rewrite_ (const ConstantNode *pre, const Expr &post)
 
virtual Expr Rewrite_ (const TupleNode *pre, const Expr &post)
 
virtual Expr Rewrite_ (const FunctionNode *pre, const Expr &post)
 
virtual Expr Rewrite_ (const CallNode *pre, const Expr &post)
 
virtual Expr Rewrite_ (const LetNode *pre, const Expr &post)
 
virtual Expr Rewrite_ (const IfNode *pre, const Expr &post)
 
virtual Expr Rewrite_ (const OpNode *pre, const Expr &post)
 
virtual Expr Rewrite_ (const TupleGetItemNode *pre, const Expr &post)
 
virtual Expr Rewrite_ (const RefCreateNode *pre, const Expr &post)
 
virtual Expr Rewrite_ (const RefReadNode *pre, const Expr &post)
 
virtual Expr Rewrite_ (const RefWriteNode *pre, const Expr &post)
 
virtual Expr Rewrite_ (const ConstructorNode *pre, const Expr &post)
 
virtual Expr Rewrite_ (const MatchNode *pre, const Expr &post)
 

Detailed Description

A non-iterating Expression Rewriter.

ExprRewriter provides a Rewrite interface for modifying graphs in Post-DFS order.

The expectation is that ExprRewriter objects will be passed to PostOrderRewrite, which will non-recursively unroll the graph and call Rewriting on inputs. It will then pass the original node, called pre, and a node recreated with any alterned inputs, called post, to the ExprRewriter. The ExprRewriter can then use the information in those two nodes to do more complex graph rewriting.

Constructor & Destructor Documentation

◆ ~ExprRewriter()

virtual tvm::relay::ExprRewriter::~ExprRewriter ( )
inlinevirtual

virtual destructor

Member Function Documentation

◆ operator()()

Expr tvm::relay::ExprRewriter::operator() ( const Expr pre,
const Expr post 
)
inline

Same as call.

Parameters
preThe expression node before rewriting.
postThe expression node with rewritten inputs.
Returns
The result of the call

◆ Rewrite()

virtual Expr tvm::relay::ExprRewriter::Rewrite ( const Expr pre,
const Expr post 
)
inlinevirtual

The functor call.

Parameters
preThe expression node before rewriting.
postThe expression node with rewritten inputs.
Returns
The result of the call

◆ Rewrite_() [1/15]

virtual Expr tvm::relay::ExprRewriter::Rewrite_ ( const CallNode pre,
const Expr post 
)
inlinevirtual

◆ Rewrite_() [2/15]

virtual Expr tvm::relay::ExprRewriter::Rewrite_ ( const ConstantNode pre,
const Expr post 
)
inlinevirtual

◆ Rewrite_() [3/15]

virtual Expr tvm::relay::ExprRewriter::Rewrite_ ( const ConstructorNode pre,
const Expr post 
)
inlinevirtual

◆ Rewrite_() [4/15]

virtual Expr tvm::relay::ExprRewriter::Rewrite_ ( const FunctionNode pre,
const Expr post 
)
inlinevirtual

◆ Rewrite_() [5/15]

virtual Expr tvm::relay::ExprRewriter::Rewrite_ ( const GlobalVarNode pre,
const Expr post 
)
inlinevirtual

◆ Rewrite_() [6/15]

virtual Expr tvm::relay::ExprRewriter::Rewrite_ ( const IfNode pre,
const Expr post 
)
inlinevirtual

◆ Rewrite_() [7/15]

virtual Expr tvm::relay::ExprRewriter::Rewrite_ ( const LetNode pre,
const Expr post 
)
inlinevirtual

◆ Rewrite_() [8/15]

virtual Expr tvm::relay::ExprRewriter::Rewrite_ ( const MatchNode pre,
const Expr post 
)
inlinevirtual

◆ Rewrite_() [9/15]

virtual Expr tvm::relay::ExprRewriter::Rewrite_ ( const OpNode pre,
const Expr post 
)
inlinevirtual

◆ Rewrite_() [10/15]

virtual Expr tvm::relay::ExprRewriter::Rewrite_ ( const RefCreateNode pre,
const Expr post 
)
inlinevirtual

◆ Rewrite_() [11/15]

virtual Expr tvm::relay::ExprRewriter::Rewrite_ ( const RefReadNode pre,
const Expr post 
)
inlinevirtual

◆ Rewrite_() [12/15]

virtual Expr tvm::relay::ExprRewriter::Rewrite_ ( const RefWriteNode pre,
const Expr post 
)
inlinevirtual

◆ Rewrite_() [13/15]

virtual Expr tvm::relay::ExprRewriter::Rewrite_ ( const TupleGetItemNode pre,
const Expr post 
)
inlinevirtual

◆ Rewrite_() [14/15]

virtual Expr tvm::relay::ExprRewriter::Rewrite_ ( const TupleNode pre,
const Expr post 
)
inlinevirtual

◆ Rewrite_() [15/15]

virtual Expr tvm::relay::ExprRewriter::Rewrite_ ( const VarNode pre,
const Expr post 
)
inlinevirtual

The documentation for this class was generated from the following file: