tvm_tirx.script.parser.ir_module

Contents

tvm_tirx.script.parser.ir_module#

tvm_tirx.script.parser.ir_module(module=None, **options)#

Decorate a Python class with two-phase module construction.

Parameters:
  • module (type, optional) – Class to compile immediately. Default is None, which returns a decorator awaiting a class.

  • **options – Keyword arguments forwarded to parse.

Returns:

object or callable – Generated module result when a class is supplied, otherwise a class decorator.

Raises:

SyntaxError – If module source violates a parser restriction.

Return type:

IRModule | Callable[[type], IRModule]

Notes

Class host bindings are captured before transpilation. Generated execution declares all registered signatures before defining their bodies. Source acquisition and builder errors propagate unchanged; frame lifetime follows parse.