19 #ifndef TVM_SCRIPT_IR_BUILDER_RELAX_FRAME_H_
20 #define TVM_SCRIPT_IR_BUILDER_RELAX_FRAME_H_
22 #include <tvm/ffi/reflection/registry.h>
31 namespace ir_builder {
39 refl::ObjectDef<RelaxFrameNode>();
42 static constexpr
const char*
_type_key =
"script.ir_builder.relax.RelaxFrame";
66 refl::ObjectDef<SeqExprFrameNode>()
71 static constexpr
const char*
_type_key =
"script.ir_builder.relax.SeqExprFrame";
116 refl::ObjectDef<FunctionFrameNode>()
127 static constexpr
const char*
_type_key =
"script.ir_builder.relax.FunctionFrame";
161 refl::ObjectDef<BlockFrameNode>()
168 static constexpr
const char*
_type_key =
"script.ir_builder.relax.BlockFrame";
201 refl::ObjectDef<IfFrameNode>()
209 static constexpr
const char*
_type_key =
"script.ir_builder.relax.IfFrame";
244 refl::ObjectDef<ThenFrameNode>();
247 static constexpr
const char*
_type_key =
"script.ir_builder.relax.ThenFrame";
282 refl::ObjectDef<ElseFrameNode>();
285 static constexpr
const char*
_type_key =
"script.ir_builder.relax.ElseFrame";
The utility for constructing Relax binding blocks.
Managed reference to RelaxExprNode.
Definition: expr.h:446
Definition: block_builder.h:264
Managed reference to an IRBuilderFrameNode.
Definition: base.h:103
The ir_builder frame for relax binding blocks.
Definition: frame.h:141
TVM_DECLARE_FINAL_OBJECT_INFO(BlockFrameNode, RelaxFrameNode)
void EnterWithScope() final
The method called when entering RAII scope.
static void RegisterReflection()
Definition: frame.h:159
bool is_dataflow
The flag that indicates whether the block is a dataflow block.
Definition: frame.h:144
Array< tvm::relax::Var > output_vars
The output vars of the dataflow block.
Definition: frame.h:157
Array< tvm::relax::Var > emitted_vars
The variables emitted in this block.
Definition: frame.h:146
bool block_ended
A boolean indicating if the dataflow block is ended of construction. If it is true,...
Definition: frame.h:152
TVM_DEFINE_MUTABLE_NOTNULLABLE_OBJECT_REF_METHODS(BlockFrame, RelaxFrame, BlockFrameNode)
A frame that represents else.
Definition: frame.h:278
static void RegisterReflection()
Definition: frame.h:280
TVM_DECLARE_FINAL_OBJECT_INFO(ElseFrameNode, SeqExprFrameNode)
void EnterWithScope() final
The method called when entering RAII scope.
Managed reference to ElseFrameNode.
Definition: frame.h:306
TVM_DEFINE_MUTABLE_NOTNULLABLE_OBJECT_REF_METHODS(ElseFrame, SeqExprFrame, ElseFrameNode)
The ir_builder frame for the relax function.
Definition: frame.h:85
tvm::relax::BlockBuilder block_builder
The block builder to create Relax function.
Definition: frame.h:112
Optional< String > name
The function name.
Definition: frame.h:92
void EnterWithScope() final
The method called when entering RAII scope.
static void RegisterReflection()
Definition: frame.h:114
void ExitWithScope() final
The method called when exiting RAII scope.
Optional< Bool > is_private
Whether the function is annotated as private.
Definition: frame.h:108
Map< String, Any > attrs
The function attributes.
Definition: frame.h:110
static constexpr const char * _type_key
Definition: frame.h:127
Optional< tvm::relax::StructInfo > ret_struct_info
The function return struct info.
Definition: frame.h:104
Optional< Bool > is_pure
Whether the function is annotated as pure.
Definition: frame.h:106
TVM_DECLARE_FINAL_OBJECT_INFO(FunctionFrameNode, SeqExprFrameNode)
Array< tvm::relax::Var > params
The function params.
Definition: frame.h:94
TVM_DEFINE_MUTABLE_NOTNULLABLE_OBJECT_REF_METHODS(FunctionFrame, SeqExprFrame, FunctionFrameNode)
A frame that represents if statement.
Definition: frame.h:186
void EnterWithScope() final
The method called when entering RAII scope.
TVM_DECLARE_FINAL_OBJECT_INFO(IfFrameNode, RelaxFrameNode)
static void RegisterReflection()
Definition: frame.h:199
tvm::relax::Var var
The Binding var.
Definition: frame.h:195
tvm::relax::Expr condition
The condition of the if statement.
Definition: frame.h:189
String var_name
The binding var name.
Definition: frame.h:197
Optional< tvm::relax::Expr > then_expr
The Bindings in the true branch.
Definition: frame.h:191
Optional< tvm::relax::Expr > else_expr
The Bindings in the false branch.
Definition: frame.h:193
Managed reference to IfFrameNode.
Definition: frame.h:230
TVM_DEFINE_MUTABLE_NOTNULLABLE_OBJECT_REF_METHODS(IfFrame, RelaxFrame, IfFrameNode)
The base ir_builder frame for the relax dialect.
Definition: frame.h:35
static constexpr const char * _type_key
Definition: frame.h:42
static void RegisterReflection()
Definition: frame.h:37
TVM_DECLARE_BASE_OBJECT_INFO(RelaxFrameNode, IRBuilderFrameNode)
TVM_DEFINE_MUTABLE_NOTNULLABLE_OBJECT_REF_METHODS(RelaxFrame, IRBuilderFrame, RelaxFrameNode)
The base ir_builder frame for frames with SeqExpr i.e. Functions, If branches.
Definition: frame.h:57
TVM_DECLARE_BASE_OBJECT_INFO(SeqExprFrameNode, RelaxFrameNode)
void EnterWithScope() override
The method called when entering RAII scope.
static void RegisterReflection()
Definition: frame.h:64
void ExitWithScope() override
The method called when exiting RAII scope.
Array< tvm::relax::BindingBlock > binding_blocks
The binding blocks inside the frame.
Definition: frame.h:60
Optional< tvm::relax::Expr > output
The frame output expr. std::nullopt when undefined.
Definition: frame.h:62
static constexpr const char * _type_key
Definition: frame.h:71
TVM_DEFINE_MUTABLE_NOTNULLABLE_OBJECT_REF_METHODS(SeqExprFrame, RelaxFrame, SeqExprFrameNode)
A frame that represents then.
Definition: frame.h:240
void EnterWithScope() final
The method called when entering RAII scope.
static void RegisterReflection()
Definition: frame.h:242
TVM_DECLARE_FINAL_OBJECT_INFO(ThenFrameNode, SeqExprFrameNode)
Managed reference to ThenFrameNode.
Definition: frame.h:268
TVM_DEFINE_MUTABLE_NOTNULLABLE_OBJECT_REF_METHODS(ThenFrame, SeqExprFrame, ThenFrameNode)
Definition: repr_printer.h:91
Performance counters for profiling via the PAPI library.
Definition: analyzer.h:37