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

A wrapper around ExprFunctor which functionally updates the AST. More...

#include <pattern_functor.h>

Inheritance diagram for tvm::relay::PatternMutator:
Collaboration diagram for tvm::relay::PatternMutator:

Public Member Functions

Pattern Mutate (const Pattern &pat)
 
Pattern VisitPattern_ (const PatternWildcardNode *op) override
 
Pattern VisitPattern_ (const PatternVarNode *op) override
 
Pattern VisitPattern_ (const PatternConstructorNode *op) override
 
Pattern VisitPattern_ (const PatternTupleNode *op) override
 
virtual Type VisitType (const Type &t)
 Used to visit the types inside of patterns. More...
 
virtual Var VisitVar (const Var &v)
 Used to visit the vars inside of patterns. More...
 
virtual Constructor VisitConstructor (const Constructor &c)
 Used to visit the vars inside of patterns. More...
 

Detailed Description

A wrapper around ExprFunctor which functionally updates the AST.

ExprMutator uses memoization and self return in order to amortize the cost of using functional updates.

Member Function Documentation

◆ Mutate()

Pattern tvm::relay::PatternMutator::Mutate ( const Pattern pat)

◆ VisitConstructor()

virtual Constructor tvm::relay::PatternMutator::VisitConstructor ( const Constructor c)
virtual

Used to visit the vars inside of patterns.

◆ VisitPattern_() [1/4]

Pattern tvm::relay::PatternMutator::VisitPattern_ ( const PatternConstructorNode op)
override

◆ VisitPattern_() [2/4]

Pattern tvm::relay::PatternMutator::VisitPattern_ ( const PatternTupleNode op)
override

◆ VisitPattern_() [3/4]

Pattern tvm::relay::PatternMutator::VisitPattern_ ( const PatternVarNode op)
override

◆ VisitPattern_() [4/4]

Pattern tvm::relay::PatternMutator::VisitPattern_ ( const PatternWildcardNode op)
override

◆ VisitType()

virtual Type tvm::relay::PatternMutator::VisitType ( const Type t)
virtual

Used to visit the types inside of patterns.

Can be overloaded to transform the types in arbitrary ways, one way would be to define a sub-class of type visitor for types which transform them appropriately.

◆ VisitVar()

virtual Var tvm::relay::PatternMutator::VisitVar ( const Var v)
virtual

Used to visit the vars inside of patterns.


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