tvm
Classes | Public Member Functions | List of all members
tvm::relax::ExprVisitor Class Reference

A simple visitor wrapper around ExprFunctor. Recursively visit the content. More...

#include <expr_functor.h>

Inheritance diagram for tvm::relax::ExprVisitor:
Collaboration diagram for tvm::relax::ExprVisitor:

Public Member Functions

void VisitExpr (const Expr &expr) override
 Generic dispatcher for Expr. More...
 
void VisitExpr_ (const ConstantNode *op) override
 
void VisitExpr_ (const TupleNode *op) override
 
void VisitExpr_ (const VarNode *op) override
 
void VisitExpr_ (const DataflowVarNode *op) override
 
void VisitExpr_ (const ShapeExprNode *op) override
 
void VisitExpr_ (const ExternFuncNode *op) override
 
void VisitExpr_ (const GlobalVarNode *op) override
 
void VisitExpr_ (const FunctionNode *op) override
 
void VisitExpr_ (const CallNode *op) override
 
void VisitExpr_ (const SeqExprNode *op) override
 
void VisitExpr_ (const IfNode *op) override
 
void VisitExpr_ (const OpNode *op) override
 
void VisitExpr_ (const TupleGetItemNode *op) override
 
void VisitExpr_ (const PrimValueNode *op) override
 
void VisitExpr_ (const StringImmNode *op) override
 
void VisitExpr_ (const DataTypeImmNode *op) override
 
virtual void VisitBinding (const Binding &binding)
 Generic dispatcher for bindings. More...
 
virtual void VisitBinding_ (const VarBindingNode *binding)
 
virtual void VisitBinding_ (const MatchCastNode *binding)
 
virtual void VisitBinding_ (const VarBindingNode *binding, const ConstantNode *val)
 
virtual void VisitBinding_ (const VarBindingNode *binding, const TupleNode *val)
 
virtual void VisitBinding_ (const VarBindingNode *binding, const VarNode *val)
 
virtual void VisitBinding_ (const VarBindingNode *binding, const DataflowVarNode *val)
 
virtual void VisitBinding_ (const VarBindingNode *binding, const ShapeExprNode *val)
 
virtual void VisitBinding_ (const VarBindingNode *binding, const ExternFuncNode *val)
 
virtual void VisitBinding_ (const VarBindingNode *binding, const GlobalVarNode *val)
 
virtual void VisitBinding_ (const VarBindingNode *binding, const FunctionNode *val)
 
virtual void VisitBinding_ (const VarBindingNode *binding, const CallNode *val)
 
virtual void VisitBinding_ (const VarBindingNode *binding, const SeqExprNode *val)
 
virtual void VisitBinding_ (const VarBindingNode *binding, const IfNode *val)
 
virtual void VisitBinding_ (const VarBindingNode *binding, const OpNode *val)
 
virtual void VisitBinding_ (const VarBindingNode *binding, const TupleGetItemNode *val)
 
virtual void VisitBinding_ (const VarBindingNode *binding, const PrimValueNode *val)
 
virtual void VisitBinding_ (const VarBindingNode *binding, const StringImmNode *val)
 
virtual void VisitBinding_ (const VarBindingNode *binding, const DataTypeImmNode *val)
 
virtual void VisitBindingBlock (const BindingBlock &block)
 Generic dispatcher for binding blocks. More...
 
virtual void VisitBindingBlock_ (const BindingBlockNode *block)
 
virtual void VisitBindingBlock_ (const DataflowBlockNode *block)
 
virtual void VisitVarDef (const Var &var)
 Generic dispatcher for visiting the var definition site. More...
 
virtual void VisitExprDepStructInfoField (const StructInfo &struct_info)
 Visit struct_info may recursively contain Expr/PrimExpr. More...
 
virtual void VisitVarDef_ (const VarNode *var)
 
virtual void VisitVarDef_ (const DataflowVarNode *var)
 
virtual void VisitSpan (const Span &span)
 
virtual void VisitPrimExpr (const PrimExpr &expr)
 

Detailed Description

A simple visitor wrapper around ExprFunctor. Recursively visit the content.

Member Function Documentation

◆ VisitBinding()

virtual void tvm::relax::ExprVisitor::VisitBinding ( const Binding binding)
virtual

Generic dispatcher for bindings.

Parameters
bindingThe binding to be visited.

◆ VisitBinding_() [1/18]

virtual void tvm::relax::ExprVisitor::VisitBinding_ ( const MatchCastNode binding)
virtual

◆ VisitBinding_() [2/18]

virtual void tvm::relax::ExprVisitor::VisitBinding_ ( const VarBindingNode binding)
virtual

◆ VisitBinding_() [3/18]

virtual void tvm::relax::ExprVisitor::VisitBinding_ ( const VarBindingNode binding,
const CallNode val 
)
virtual

◆ VisitBinding_() [4/18]

virtual void tvm::relax::ExprVisitor::VisitBinding_ ( const VarBindingNode binding,
const ConstantNode val 
)
virtual

◆ VisitBinding_() [5/18]

virtual void tvm::relax::ExprVisitor::VisitBinding_ ( const VarBindingNode binding,
const DataflowVarNode val 
)
virtual

◆ VisitBinding_() [6/18]

virtual void tvm::relax::ExprVisitor::VisitBinding_ ( const VarBindingNode binding,
const DataTypeImmNode val 
)
virtual

◆ VisitBinding_() [7/18]

virtual void tvm::relax::ExprVisitor::VisitBinding_ ( const VarBindingNode binding,
const ExternFuncNode val 
)
virtual

◆ VisitBinding_() [8/18]

virtual void tvm::relax::ExprVisitor::VisitBinding_ ( const VarBindingNode binding,
const FunctionNode val 
)
virtual

◆ VisitBinding_() [9/18]

virtual void tvm::relax::ExprVisitor::VisitBinding_ ( const VarBindingNode binding,
const GlobalVarNode val 
)
virtual

◆ VisitBinding_() [10/18]

virtual void tvm::relax::ExprVisitor::VisitBinding_ ( const VarBindingNode binding,
const IfNode val 
)
virtual

◆ VisitBinding_() [11/18]

virtual void tvm::relax::ExprVisitor::VisitBinding_ ( const VarBindingNode binding,
const OpNode val 
)
virtual

◆ VisitBinding_() [12/18]

virtual void tvm::relax::ExprVisitor::VisitBinding_ ( const VarBindingNode binding,
const PrimValueNode val 
)
virtual

◆ VisitBinding_() [13/18]

virtual void tvm::relax::ExprVisitor::VisitBinding_ ( const VarBindingNode binding,
const SeqExprNode val 
)
virtual

◆ VisitBinding_() [14/18]

virtual void tvm::relax::ExprVisitor::VisitBinding_ ( const VarBindingNode binding,
const ShapeExprNode val 
)
virtual

◆ VisitBinding_() [15/18]

virtual void tvm::relax::ExprVisitor::VisitBinding_ ( const VarBindingNode binding,
const StringImmNode val 
)
virtual

◆ VisitBinding_() [16/18]

virtual void tvm::relax::ExprVisitor::VisitBinding_ ( const VarBindingNode binding,
const TupleGetItemNode val 
)
virtual

◆ VisitBinding_() [17/18]

virtual void tvm::relax::ExprVisitor::VisitBinding_ ( const VarBindingNode binding,
const TupleNode val 
)
virtual

◆ VisitBinding_() [18/18]

virtual void tvm::relax::ExprVisitor::VisitBinding_ ( const VarBindingNode binding,
const VarNode val 
)
virtual

◆ VisitBindingBlock()

virtual void tvm::relax::ExprVisitor::VisitBindingBlock ( const BindingBlock block)
virtual

Generic dispatcher for binding blocks.

Parameters
blockThe binding block to be visited.

◆ VisitBindingBlock_() [1/2]

virtual void tvm::relax::ExprVisitor::VisitBindingBlock_ ( const BindingBlockNode block)
virtual

◆ VisitBindingBlock_() [2/2]

virtual void tvm::relax::ExprVisitor::VisitBindingBlock_ ( const DataflowBlockNode block)
virtual

◆ VisitExpr()

void tvm::relax::ExprVisitor::VisitExpr ( const Expr expr)
override

Generic dispatcher for Expr.

Parameters
exprThe expr to be visited.

◆ VisitExpr_() [1/16]

void tvm::relax::ExprVisitor::VisitExpr_ ( const CallNode op)
override

◆ VisitExpr_() [2/16]

void tvm::relax::ExprVisitor::VisitExpr_ ( const ConstantNode op)
override

◆ VisitExpr_() [3/16]

void tvm::relax::ExprVisitor::VisitExpr_ ( const DataflowVarNode op)
override

◆ VisitExpr_() [4/16]

void tvm::relax::ExprVisitor::VisitExpr_ ( const DataTypeImmNode op)
override

◆ VisitExpr_() [5/16]

void tvm::relax::ExprVisitor::VisitExpr_ ( const ExternFuncNode op)
override

◆ VisitExpr_() [6/16]

void tvm::relax::ExprVisitor::VisitExpr_ ( const FunctionNode op)
override

◆ VisitExpr_() [7/16]

void tvm::relax::ExprVisitor::VisitExpr_ ( const GlobalVarNode op)
override

◆ VisitExpr_() [8/16]

void tvm::relax::ExprVisitor::VisitExpr_ ( const IfNode op)
override

◆ VisitExpr_() [9/16]

void tvm::relax::ExprVisitor::VisitExpr_ ( const OpNode op)
override

◆ VisitExpr_() [10/16]

void tvm::relax::ExprVisitor::VisitExpr_ ( const PrimValueNode op)
override

◆ VisitExpr_() [11/16]

void tvm::relax::ExprVisitor::VisitExpr_ ( const SeqExprNode op)
override

◆ VisitExpr_() [12/16]

void tvm::relax::ExprVisitor::VisitExpr_ ( const ShapeExprNode op)
override

◆ VisitExpr_() [13/16]

void tvm::relax::ExprVisitor::VisitExpr_ ( const StringImmNode op)
override

◆ VisitExpr_() [14/16]

void tvm::relax::ExprVisitor::VisitExpr_ ( const TupleGetItemNode op)
override

◆ VisitExpr_() [15/16]

void tvm::relax::ExprVisitor::VisitExpr_ ( const TupleNode op)
override

◆ VisitExpr_() [16/16]

void tvm::relax::ExprVisitor::VisitExpr_ ( const VarNode op)
override

◆ VisitExprDepStructInfoField()

virtual void tvm::relax::ExprVisitor::VisitExprDepStructInfoField ( const StructInfo struct_info)
virtual

Visit struct_info may recursively contain Expr/PrimExpr.

By default, this function recurse into struct info such as TensorStructInfo and ShapeStructInfo and call VisitExpr/VisitPrimExpr accordingly. It does not recurse into FunctionStructInfo as it does not contain Expr defined in the current scope.

Pass writers can overload this function to change to other behaviors. For example, if we are not interested in Expr in StructInfo, we can override this function by a no-op.

Parameters
struct_infoInput struct info field.

◆ VisitPrimExpr()

virtual void tvm::relax::ExprVisitor::VisitPrimExpr ( const PrimExpr expr)
virtual

◆ VisitSpan()

virtual void tvm::relax::ExprVisitor::VisitSpan ( const Span span)
virtual

◆ VisitVarDef()

virtual void tvm::relax::ExprVisitor::VisitVarDef ( const Var var)
virtual

Generic dispatcher for visiting the var definition site.

Parameters
varThe var to be visited.
Note
VisitExpr_(const VarNode*) will only visit the usage site of an Var

◆ VisitVarDef_() [1/2]

virtual void tvm::relax::ExprVisitor::VisitVarDef_ ( const DataflowVarNode var)
virtual

◆ VisitVarDef_() [2/2]

virtual void tvm::relax::ExprVisitor::VisitVarDef_ ( const VarNode var)
virtual

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