tvm_tirx.script.parser.protocol_registry.register_scalar_annotation#
- tvm_tirx.script.parser.protocol_registry.register_scalar_annotation(namespace_path, constructor, *, dtype=None)#
Register the dtype of a fixed scalar annotation without evaluating it.
- Parameters:
namespace_path (str) – Canonical registered namespace alias and exported callable path, such as
"tirx.int32". A later registration at this path replaces its dtype.constructor (Callable) – Callable providing the eager construction operation. Registration records its syntax path without invoking or wrapping this callable.
dtype (object, optional) – Static scalar dtype for an explicit PEP 695 symbol bound. None (the default) leaves the annotation without a supported scalar bound dtype.
- Returns:
Callable – The exact
constructorobject.- Return type:
_Callable
Notes
This metadata does not give constructor calls special assignment semantics. Scalar runtime parameters retain their ordinary annotation construction.
register_scalar_annotation("tirx.int32", T.int32, dtype="int32") # Source: def f[n: T.int32](...): # Builder: n = I.dynamic("n", "int32")