tvm
|
A mutator works in unnormalized form. More...
#include <expr_functor.h>
Public Member Functions | |
Expr | VisitExpr (const Expr &expr) override |
Expr | VisitExpr_ (const ConstantNode *op) override |
Expr | VisitExpr_ (const TupleNode *op) override |
Expr | VisitExpr_ (const VarNode *op) override |
Expr | VisitExpr_ (const DataflowVarNode *op) override |
Expr | VisitExpr_ (const ShapeExprNode *op) override |
Expr | VisitExpr_ (const ExternFuncNode *op) override |
Expr | VisitExpr_ (const GlobalVarNode *op) override |
Expr | VisitExpr_ (const FunctionNode *op) override |
Expr | VisitExpr_ (const CallNode *op) override |
Expr | VisitExpr_ (const SeqExprNode *op) override |
Expr | VisitExpr_ (const IfNode *op) override |
Expr | VisitExpr_ (const OpNode *op) override |
Expr | VisitExpr_ (const TupleGetItemNode *op) override |
Expr | VisitExpr_ (const PrimValueNode *op) override |
Expr | VisitExpr_ (const StringImmNode *op) override |
Expr | VisitExpr_ (const DataTypeImmNode *op) override |
virtual BindingBlock | VisitBindingBlock (const BindingBlock &block) |
Mutate BindingBlock. More... | |
virtual PrimExpr | VisitPrimExpr (const PrimExpr &expr) |
Used to visit the PrimExpr inside of expressions. More... | |
virtual StructInfo | VisitExprDepStructInfoField (const StructInfo &struct_info) |
Visit struct_info that may recursively contain Expr/PrimExpr. More... | |
Protected Member Functions | |
bool | VisitAndCheckStructInfoFieldUnchanged (const ObjectRef &struct_info) |
Check whether VisitExprDepStructInfoField change struct_info. More... | |
A mutator works in unnormalized form.
ExprMutatorBase expects input AST to be in the unnormalized form, i.e., checked_type_ and shape_ of expressions can be nullptr, and the expressions may nest(and as a result the AST is not in ANF).
|
inlineprotected |
Check whether VisitExprDepStructInfoField change struct_info.
|
virtual |
Mutate BindingBlock.
block | The binding block to be visited. |
Reimplemented in tvm::relax::ExprMutator.
|
override |
|
override |
|
override |
|
override |
|
override |
|
override |
|
override |
|
override |
|
override |
|
override |
|
override |
|
virtual |
Visit struct_info that 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 in Expr in StructInfo won't change, we can override this function by an identity function.
struct_info | Input struct info field. |
Used to visit the PrimExpr inside of expressions.
Can be overloaded to transform the shape expressions.