tvm.script.parser

tvm.script.parser

The parser

tvm.script.parser.parse(program: AST | Any | str, extra_vars: dict[str, Any] | None = None, check_well_formed: bool = True) Any

Register a method for a operand type, AST operator node and operand index.

Parameters:
  • program (Union[doc.AST, Any, str]) – The TVMScript code to parse.

  • extra_vars (Dict[str, Any]) – The extra variable table for parsing.

  • check_well_formed (bool) – Whether to check well-formedness after parsing.

Returns:

func – The parsed TVMScript program.

Return type:

Any

tvm.script.parser.ir_module(mod: type | None = None, check_well_formed: bool = True) IRModule

The parsing method for ir module, by using @ir_module as decorator.

Parameters:
  • mod (Type) – The class to be parsed as ir module.

  • check_well_formed (bool) – Whether to check well-formedness during parsing.

Returns:

ir_module – The parsed ir module.

Return type:

IRModule

tvm.script.parser.ir

The ir module parser

tvm.script.parser.relax

Initial impl of relax parser for sugars

tvm.script.parser.tirx

The tirx parser