tvm
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
tvm::relax::transform::FusionPatternNode Class Reference

The pattern object used as the input of FuseOpsByPattern. For bindings to be fused, it needs to be matched with pattern and the check function needs to return true. More...

#include <transform.h>

Inheritance diagram for tvm::relax::transform::FusionPatternNode:
Collaboration diagram for tvm::relax::transform::FusionPatternNode:

Public Member Functions

 TVM_FFI_DECLARE_OBJECT_INFO_FINAL ("relax.transform.FusionPattern", FusionPatternNode, Object)
 

Static Public Member Functions

static void RegisterReflection ()
 

Public Attributes

ffi::String name
 The name of pattern. It becomes the value of the kComposite attribute of a fused function after successful matching. More...
 
DFPattern pattern
 The dataflow pattern that will be used to match expression in the DataflowBlock. All the call nodes covered by the pattern will be extracted into the fused function. More...
 
ffi::Map< ffi::String, DFPatternannotation_patterns
 The map which is used to extract important expressions from the pattern match result. All DFPattern in this map should be part of the pattern. More...
 
ffi::Optional< ffi::Function > check
 The function to determine whether the match result is accepted. This can be std::nullopt if check function is not necessary for this pattern. More...
 
ffi::Optional< ffi::Function > attrs_getter
 The function to get attributes for fused function. More...
 

Detailed Description

The pattern object used as the input of FuseOpsByPattern. For bindings to be fused, it needs to be matched with pattern and the check function needs to return true.

Member Function Documentation

◆ RegisterReflection()

static void tvm::relax::transform::FusionPatternNode::RegisterReflection ( )
inlinestatic

◆ TVM_FFI_DECLARE_OBJECT_INFO_FINAL()

tvm::relax::transform::FusionPatternNode::TVM_FFI_DECLARE_OBJECT_INFO_FINAL ( "relax.transform.FusionPattern"  ,
FusionPatternNode  ,
Object   
)

Member Data Documentation

◆ annotation_patterns

ffi::Map<ffi::String, DFPattern> tvm::relax::transform::FusionPatternNode::annotation_patterns

The map which is used to extract important expressions from the pattern match result. All DFPattern in this map should be part of the pattern.

◆ attrs_getter

ffi::Optional<ffi::Function> tvm::relax::transform::FusionPatternNode::attrs_getter

The function to get attributes for fused function.

It should have signature ffi::Map<ffi::String, Any>(const ffi::Map<ffi::String, Expr>& context)

◆ check

ffi::Optional<ffi::Function> tvm::relax::transform::FusionPatternNode::check

The function to determine whether the match result is accepted. This can be std::nullopt if check function is not necessary for this pattern.

It should have signature bool(const PatternCheckContext& context)

◆ name

ffi::String tvm::relax::transform::FusionPatternNode::name

The name of pattern. It becomes the value of the kComposite attribute of a fused function after successful matching.

◆ pattern

DFPattern tvm::relax::transform::FusionPatternNode::pattern

The dataflow pattern that will be used to match expression in the DataflowBlock. All the call nodes covered by the pattern will be extracted into the fused function.


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