tvm_tirx.script.parser.register_namespace

tvm_tirx.script.parser.register_namespace#

tvm_tirx.script.parser.register_namespace(alias, namespace)#

Register an opaque fixed namespace; its first alias is the syntax key root.

Parameters:
  • alias (str) – Source name for the namespace, such as "ir" or "minilang". The first registered alias for an object is its canonical syntax-policy prefix; additional aliases for that object resolve to the same prefix.

  • namespace (object) – Namespace object exposing construction operations or source decorators. It is borrowed without copying or inspecting its members.

Returns:

None – Registration updates the namespaces available to subsequent parses.

Return type:

None

Notes

Each parse borrows these explicitly registered defaults. Replacing an alias affects future parses only; registration enters no builder frame and inspects no namespace members. Imported extension objects also work through Python scope without registration. Text parsing can receive them through imports or extra_vars; exposing an op or type does not register a parser default.