|
| TVM_TIRX_DLL | OpDef (const ffi::String &name) |
| | Get or create the named Op without changing its documentation.
|
| |
| TVM_TIRX_DLL | OpDef (const ffi::String &name, const ffi::String &doc) |
| | Get or create the named Op and set its documentation.
|
| |
| | OpDef (const OpDef &)=delete |
| |
| OpDef & | operator= (const OpDef &)=delete |
| |
| | OpDef (OpDef &&)=delete |
| |
| OpDef & | operator= (OpDef &&)=delete |
| |
| Op | op () const |
| | Get the canonical operator.
|
| |
| void | expose () const |
| | Request API exposure after this operator's signature and attributes are complete.
|
| |
| TVM_TIRX_DLL OpDef & | add_arg (const ffi::String &name, const ffi::String &doc) |
| | Append a required value-argument descriptor.
|
| |
| template<typename AttrsType > |
| OpDef & | attrs_type () |
| | Set the attribute object type key and runtime index together.
|
| |
| TVM_TIRX_DLL OpDef & | set_attrs_type_key (const ffi::String &key) |
| | Resolve and set the attribute object type key and runtime index together.
|
| |
| TVM_TIRX_DLL OpDef & | add_ty_arg (const ffi::String &name, const ffi::String &doc) |
| | Append a descriptor for a type argument in Call.ty_args.
|
| |
| template<typename... Specs> |
| OpDef & | signature (const Specs &... specs) |
| | Register a complete typed Call signature and its validator.
|
| |
| template<typename ValueType > |
| OpDef & | set_attr (const ffi::String &attr_name, const ValueType &value, bool override=false) |
| | Register an extensible attribute, rejecting duplicates unless overridden.
|
| |
| template<typename ValueType , typename Value , std::enable_if_t<(std::is_convertible_v< Value &&, ValueType > &&((!std::is_same_v< std::decay_t< Value >, ffi::Any > &&!std::is_same_v< std::decay_t< Value >, ffi::AnyView >)||std::is_same_v< ValueType, ffi::Any >||std::is_same_v< ValueType, ffi::AnyView >)), int > = 0> |
| OpDef & | set_attr (ffi::reflection::AttrKey< ValueType > key, Value &&value, bool override=false) |
| | Register a value using the key's declared type.
|
| |
| template<auto Fn, typename ValueType > |
| OpDef & | set_native_fn_attr (ffi::reflection::AttrKey< ValueType > key, bool override=false) |
| | Register a native callback using the key's declared adapter.
|
| |
| OpDef & | set_validator (ffi::reflection::NativeFunctionView< void(const CallObj *)> validator, bool override=false) |
| | Register a validator that checks a Call with this operator.
|
| |
| TVM_TIRX_DLL OpDef & | reset_attr (const ffi::String &attr_name) |
| | Remove the current attribute value, with no priority fallback.
|
| |
| template<typename ValueType > |
| OpDef & | reset_attr (ffi::reflection::AttrKey< ValueType > key) |
| | Remove the value named by a typed key. Cached views observe the removal.
|
| |
Noncopyable temporary builder for a canonical Op; see Op for the example.
template<typename ValueType , typename Value , std::enable_if_t<(std::is_convertible_v< Value &&, ValueType > &&((!std::is_same_v< std::decay_t< Value >, ffi::Any > &&!std::is_same_v< std::decay_t< Value >, ffi::AnyView >)||std::is_same_v< ValueType, ffi::Any >||std::is_same_v< ValueType, ffi::AnyView >)), int > = 0>
| OpDef & tvm::OpDef::set_attr |
( |
ffi::reflection::AttrKey< ValueType > |
key, |
|
|
Value && |
value, |
|
|
bool |
override = false |
|
) |
| |
|
inline |
Register a value using the key's declared type.
- Parameters
-
| key | Attribute column key. |
| value | Value convertible to the key's type; erased values require explicit extraction. |
| override | Whether to replace an existing value. |
- Returns
- This builder. Stored callbacks retain their packed function owner.
template<typename... Specs>
| OpDef & tvm::OpDef::signature |
( |
const Specs &... |
specs | ) |
|
|
inline |
Register a complete typed Call signature and its validator.
Fixed descriptors require exactly one value/type argument each. A variadic tail accepts zero or more trailing arguments of its category. Validation throws on arity or class mismatch; it does not infer types or mutate the Call. Call::Validate invokes the validator separately from construction. Without call_attrs<T>, Call.attrs is unconstrained. Repeated registration replaces metadata but retains any existing validator, including a generated one. Replace the callback explicitly if its executable checks must change.
sig::arg("value"),
sig::arg<PrimExpr>("index"),
sig::var_args<PrimExpr>("rest"),
sig::ty_arg("T"),
sig::var_ty_args("Ts"),
sig::call_attrs<DictAttrsObj>());
Noncopyable temporary builder for a canonical Op; see Op for the example.
Definition op.h:467
OpDef & signature(const Specs &... specs)
Register a complete typed Call signature and its validator.
Definition op.h:546