|
| template<typename ValueType > |
| static OpAttrMap< ValueType > | GetAttrMap (const ffi::String &attr_name) |
| | Get a typed live view of a registered attribute column.
|
| |
| static TVM_TIRX_DLL bool | HasAttrMap (const ffi::String &attr_name) |
| | Check whether an attribute column exists, even if some Ops lack a value.
|
| |
| static TVM_TIRX_DLL Op | Get (const ffi::String &op_name) |
| | Look up a registered operator by name.
|
| |
| static TVM_TIRX_DLL ffi::Array< ffi::String > | ListNames () |
| | List registered operator names.
|
| |
Reference-counted handle to a canonical named operator.
OpDef temporarily builds metadata on the same Op returned by Get. Independent registrations may attach different attributes; replacing an existing attribute requires explicit override. Cached attribute maps observe subsequent changes. args_info describes required value operands; var_args_info permits a suffix. ty_args_info describes type arguments; a typed signature installs a validator that checks their count and classes.
TVM_FFI_STATIC_INIT_BLOCK() {
OpDef(
"example.identity",
"Return the input expression.")
.
signature(sig::arg(
"value",
"The input expression."))
}
bool pure = Op::GetAttrMap<bool>("FPurity")[op];
Noncopyable temporary builder for a canonical Op; see Op for the example.
Definition op.h:440
OpDef & set_attr(const ffi::String &attr_name, const ValueType &value, bool override=false)
Register an extensible attribute, rejecting duplicates unless overridden.
Definition op.h:540
OpDef & signature(const Specs &... specs)
Register a complete typed Call signature and its validator.
Definition op.h:514
Reference-counted handle to a canonical named operator.
Definition op.h:147
static TVM_TIRX_DLL Op Get(const ffi::String &op_name)
Look up a registered operator by name.