tvm.script.printer#
tvm.script.printer#
TVMScript Unified Printer This package provides a set of APIs to print supported TVM IR into TVMScript in a roundtrippable way.
- class tvm.script.printer.PrinterConfig(*, name: str | None = None, show_meta: bool = False, ir_prefix: str = 'I', module_alias: str = 'cls', buffer_dtype: str = 'float32', int_dtype: str = 'int32', float_dtype: str = 'void', verbose_expr: bool = False, indent_spaces: int = 4, print_line_numbers: bool = False, num_context_lines: int | None = None, show_all_ty: bool = True, extra_config: dict | None = None, path_to_underline: list[AccessPath] | None = None, path_to_annotate: dict[AccessPath, str] | None = None, obj_to_underline: list[Object] | None = None, obj_to_annotate: dict[Object, str] | None = None)#
Configuration of TVMScript printer.
The
int_dtypeandfloat_dtypearguments populate the string-valuedir.int_dtypeandir.float_dtypeentries inextra_config. Explicit entries inextra_configoverride those arguments.tirx.scalar_buffer_as_mutable_varinextra_configdefaults to true. It prints eligible local scalar buffers as typed mutable variables. Set it to false to retain explicit buffer allocations and indexed loads/stores.