tvm.script

tvm.script

TVM Script APIs of TVM Python Package

tvm.script.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.from_source(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.relax

TVM Script APIs of TVM Python Package for Relax

tvm.script.tirx

TVM Script APIs of TVM Python Package for TIR