You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by "leandron (via GitHub)" <gi...@apache.org> on 2023/03/21 16:15:22 UTC
[GitHub] [tvm] leandron commented on a diff in pull request #13934: [TVMScript] Support `show_meta`
leandron commented on code in PR #13934:
URL: https://github.com/apache/tvm/pull/13934#discussion_r1143659008
##########
python/tvm/runtime/script_printer.py:
##########
@@ -65,38 +69,49 @@ def __init__(
) -> None:
if num_context_lines is None:
num_context_lines = -1
+ cfg = {
+ "show_meta": show_meta,
+ "ir_prefix": ir_prefix,
+ "tir_prefix": tir_prefix,
+ "relax_prefix": relax_prefix,
+ "buffer_dtype": buffer_dtype,
+ "int_dtype": int_dtype,
+ "float_dtype": float_dtype,
+ "verbose_expr": verbose_expr,
+ "indent_spaces": indent_spaces,
+ "print_line_numbers": print_line_numbers,
+ "num_context_lines": num_context_lines,
+ "syntax_sugar": syntax_sugar,
+ "path_to_underline": path_to_underline,
+ "path_to_annotate": path_to_annotate,
+ "obj_to_underline": obj_to_underline,
+ "obj_to_annotate": obj_to_annotate,
+ }
+
+ if name is not None:
+ cfg["name"] = name
self.__init_handle_by_constructor__(
- _ffi_node_api.PrinterConfig, # type: ignore # pylint: disable=no-member
- {
- "ir_prefix": ir_prefix,
- "tir_prefix": tir_prefix,
- "relax_prefix": relax_prefix,
- "buffer_dtype": buffer_dtype,
- "int_dtype": int_dtype,
- "float_dtype": float_dtype,
- "verbose_expr": verbose_expr,
- "indent_spaces": indent_spaces,
- "print_line_numbers": print_line_numbers,
- "num_context_lines": num_context_lines,
- "syntax_sugar": syntax_sugar,
- "path_to_underline": path_to_underline,
- "path_to_annotate": path_to_annotate,
- "obj_to_underline": obj_to_underline,
- "obj_to_annotate": obj_to_annotate,
- },
+ _ffi_node_api.PrinterConfig, cfg # type: ignore # pylint: disable=no-member
)
def _script(obj: Object, config: PrinterConfig) -> str:
return _ffi_node_api.TVMScriptPrinterScript(obj, config) # type: ignore # pylint: disable=no-member
+def _relax_script(obj: Object, config: PrinterConfig) -> str:
+ func = get_global_func("script.printer.ReprPrintRelax")
+ return func(obj, config)
+
+
Review Comment:
Hi @junrushao - it seems this function accidentally was merged into `main` as opposed to `unity` - can you push a follow-up PR and change it to the appropriate branch?
It is one of the cases that a change was meted quite soon (in about 5h I think) so not many people were able to look into it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org