tvm
|
Base node of all functions. More...
#include <function.h>
Public Member Functions | |
template<typename TObjectRef > | |
Optional< TObjectRef > | GetAttr (const std::string &attr_key, Optional< TObjectRef > default_value=std::nullopt) const |
Get a function attribute. More... | |
template<typename TObjectRef > | |
Optional< TObjectRef > | GetAttr (const std::string &attr_key, TObjectRef default_value) const |
bool | HasNonzeroAttr (const std::string &attr_key) const |
Check whether the function has an non-zero integer attr. More... | |
LinkageType | GetLinkageType () const |
Get the type of the linkage. More... | |
TVM_DECLARE_BASE_OBJECT_INFO (BaseFuncNode, RelaxExprNode) | |
![]() | |
TVM_DECLARE_BASE_OBJECT_INFO (RelaxExprNode, BaseExprNode) | |
![]() | |
TVM_DECLARE_BASE_OBJECT_INFO (BaseExprNode, Object) | |
Static Public Member Functions | |
static void | RegisterReflection () |
![]() | |
static void | RegisterReflection () |
![]() | |
static void | RegisterReflection () |
Public Attributes | |
DictAttrs | attrs |
Additional attributes storing the meta-data. More... | |
![]() | |
Optional< ObjectRef > | struct_info_ = Optional<ObjectRef>() |
Stores the result of structure information of the expression that encapsulate both static shape and runtime information such as shape. More... | |
![]() | |
Span | span |
Span that points to the original source code. Reserved debug information. More... | |
Static Public Attributes | |
static constexpr const char * | _type_key = "ir.BaseFunc" |
static constexpr const uint32_t | _type_child_slots = 2 |
![]() | |
static constexpr const char * | _type_key = "ir.RelaxExpr" |
static constexpr const uint32_t | _type_child_slots = 22 |
![]() | |
static constexpr const char * | _type_key = "ir.BaseExpr" |
static constexpr TVMFFISEqHashKind | _type_s_eq_hash_kind = kTVMFFISEqHashKindTreeNode |
static constexpr const uint32_t | _type_child_slots = 64 |
Base node of all functions.
We support several variants of functions throughout the stack. All of the functions share the same type system to support cross variant calls.
|
inline |
Get a function attribute.
attr_key | The attribute key. |
default_value | The default value if the key does not exist, defaults to nullptr. |
TOBjectRef | the expected object type. |
Error | if the key exists but the value does not match TObjectRef |
|
inline |
|
inline |
Get the type of the linkage.
Currently, we only consider external/internal linkage. This can be extended in the future when necessary.
|
inline |
Check whether the function has an non-zero integer attr.
This function can be used to check whether an optional attribute mark(e.g. inline) exists.
attr_key | The key to the attribute. |
|
inlinestatic |
tvm::BaseFuncNode::TVM_DECLARE_BASE_OBJECT_INFO | ( | BaseFuncNode | , |
RelaxExprNode | |||
) |
|
staticconstexpr |
|
staticconstexpr |
DictAttrs tvm::BaseFuncNode::attrs |
Additional attributes storing the meta-data.