tvm
Classes | Namespaces | Macros
pattern_functor.h File Reference

A more powerful visitor on ADT patterns that enables defining arbitrary function signatures with type-based dispatch on first argument. More...

#include <tvm/node/functor.h>
#include <tvm/relay/error.h>
#include <string>
#include <unordered_map>
#include <utility>
#include "./adt.h"
#include "./expr.h"
#include "./op.h"
Include dependency graph for pattern_functor.h:

Go to the source code of this file.

Classes

class  tvm::relay::PatternFunctor< R(const Pattern &n, Args...)>
 
class  tvm::relay::PatternVisitor
 A simple visitor wrapper around PatternFunctor. More...
 
class  tvm::relay::PatternMutator
 A wrapper around ExprFunctor which functionally updates the AST. More...
 

Namespaces

 tvm
 runtime implementation for LibTorch/TorchScript.
 
 tvm::relay
 Relay: a high level functional IR for TVM.
 

Macros

#define PATTERN_FUNCTOR_DEFAULT    { return VisitPatternDefault_(op, std::forward<Args>(args)...); }
 
#define RELAY_PATTERN_FUNCTOR_DISPATCH(OP)
 

Detailed Description

A more powerful visitor on ADT patterns that enables defining arbitrary function signatures with type-based dispatch on first argument.

Macro Definition Documentation

◆ PATTERN_FUNCTOR_DEFAULT

#define PATTERN_FUNCTOR_DEFAULT    { return VisitPatternDefault_(op, std::forward<Args>(args)...); }

◆ RELAY_PATTERN_FUNCTOR_DISPATCH

#define RELAY_PATTERN_FUNCTOR_DISPATCH (   OP)
Value:
vtable.template set_dispatch<OP>([](const ObjectRef& n, TSelf* self, Args... args) { \
return self->VisitPattern_(static_cast<const OP*>(n.get()), std::forward<Args>(args)...); \
});