tvm_tirx.script.parser.register_namespace_initializer

tvm_tirx.script.parser.register_namespace_initializer#

tvm_tirx.script.parser.register_namespace_initializer(initializer, *, aliases=())#

Register a lazy bootstrap callback without importing the language variant.

Parameters:
  • initializer (Callable[[], None]) – Callback that registers the language variant’s namespaces. It receives no arguments and is called during the parser’s first initialization. If initialization has already completed, a newly registered callback runs immediately. Re-registering the same callback object does not enqueue or invoke it again.

  • aliases (tuple[str, ...], optional) – Names whose attribute lookup should trigger initialization. Defaults to an empty tuple. These names advertise lazy namespaces; the callback must still register their actual objects with register_namespace(). Aliases are added even when the callback was previously registered.

Returns:

None – The callback is registered, and invoked immediately when the parser is already initialized.

Return type:

None