#include <expr.h>
|
| Function (Array< Var > params, Expr body, Optional< StructInfo > ret_struct_info, bool is_pure=true, DictAttrs attrs=DictAttrs(), Span span=Span()) |
| Construct a Relax Function. More...
|
|
| TVM_DEFINE_OBJECT_REF_METHODS (Function, BaseFunc, FunctionNode) |
|
| TVM_DEFINE_OBJECT_REF_COW_METHOD (FunctionNode) |
|
| TVM_DEFINE_OBJECT_REF_METHODS (BaseFunc, RelaxExpr, BaseFuncNode) |
|
| TVM_DEFINE_OBJECT_REF_METHODS (RelaxExpr, BaseExpr, RelaxExprNode) |
|
| TVM_DEFINE_OBJECT_REF_METHODS (BaseExpr, ObjectRef, BaseExprNode) |
|
◆ Function()
Construct a Relax Function.
- Parameters
-
params | The parameters accepted by the function |
body | The body of the function. If this is not a SeqExpr, it will be wrapped in a SeqExpr, to satisfy the Relax IR requirement that all scopes be contained in a SeqExpr. |
ret_struct_info | The StructInfo returned by the function. If std::nullopt, will be inferred from the StructInfo of the function's body. |
is_pure | The purity of the function. |
attrs | Any attributes associated with the function. Defaults to an empty dictionary. |
span | The source span of the expression. |
◆ CreateEmpty()
Mimics the constructor but without body Expr.
- Note
- ret_struct_info is required, since it can not deduced by the body.
◆ TVM_DEFINE_OBJECT_REF_COW_METHOD()
tvm::relax::Function::TVM_DEFINE_OBJECT_REF_COW_METHOD |
( |
FunctionNode |
| ) |
|
◆ TVM_DEFINE_OBJECT_REF_METHODS()
The documentation for this class was generated from the following file: