leandron commented on code in PR #13934:
URL: https://github.com/apache/tvm/pull/13934#discussion_r1143878394


##########
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:
   Doing a bit more digging, this is actually technical debt/bug as 
`script.printer.ReprPrintRelax` is not something that exists in this code base, 
rather than any _future proofing_, so I'd like for this to be seriously 
considered for a fix.
   
   Moreover, it is not really scoped as it is half here, and half in a separate 
branch.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to