|
tvm
|
Managed reference to DictAttrsNode. More...
#include <attrs.h>
Public Types | |
| using | __PtrType = std::conditional_t< DictAttrsNode::_type_mutable, DictAttrsNode *, const DictAttrsNode * > |
| using | ContainerType = DictAttrsNode |
Public Member Functions | |
| DictAttrs (ffi::Map< ffi::String, Any > dict={}) | |
| Construct a DictAttrs backed by DictAttrsNode. | |
| DictAttrs (DictAttrs &&other) noexcept | |
Move constructor that leaves the source in a defined-but-empty state rather than null, preserving the NOTNULLABLE invariant even after std::move. | |
| DictAttrs & | operator= (DictAttrs &&other) noexcept |
Move assignment that leaves the source in a defined-but-empty state rather than null, preserving the NOTNULLABLE invariant even after std::move. | |
| DictAttrs (const DictAttrs &other)=default | |
| DictAttrs & | operator= (const DictAttrs &other)=default |
| template<typename TObjectRef > | |
| ffi::Optional< TObjectRef > | GetAttr (const std::string &attr_key, ffi::Optional< TObjectRef > default_value=ffi::Optional< TObjectRef >(std::nullopt)) const |
| Get a function attribute. | |
| template<typename TObjectRef > | |
| ffi::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. | |
| DictAttrs (::tvm::ffi::UnsafeInit tag) | |
| __PtrType | operator-> () const |
| __PtrType | get () const |
| TVM_DEFINE_OBJECT_REF_COW_METHOD (DictAttrsNode) | |
Public Member Functions inherited from tvm::Attrs | |
| TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE (Attrs, ffi::ObjectRef, AttrsNode) | |
Static Public Attributes | |
| static constexpr bool | _type_is_nullable = false |
Managed reference to DictAttrsNode.
_type_is_nullable == false), andir.IRModule explicitly normalizing a missing/None attrs argument to DictAttrs() before forwarding to the C++ constructor. Callers (including third-party code via templates like WithAttr) can therefore rely on attrs->dict being safe to dereference without a .defined() guard. | using tvm::DictAttrs::__PtrType = std::conditional_t<DictAttrsNode::_type_mutable, DictAttrsNode*, const DictAttrsNode*> |
|
inlineexplicit |
Construct a DictAttrs backed by DictAttrsNode.
The no-argument form constructs an empty (but always defined) DictAttrs.
| dict | The attributes. |
|
inlinenoexcept |
Move constructor that leaves the source in a defined-but-empty state rather than null, preserving the NOTNULLABLE invariant even after std::move.
|
inlineexplicit |
|
inline |
|
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 |
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. |
|
inline |
Move assignment that leaves the source in a defined-but-empty state rather than null, preserving the NOTNULLABLE invariant even after std::move.
| tvm::DictAttrs::TVM_DEFINE_OBJECT_REF_COW_METHOD | ( | DictAttrsNode | ) |