This is an automated email from the ASF dual-hosted git repository.

tqchen pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git


The following commit(s) were added to refs/heads/main by this push:
     new 3baeffbb07 [REFACTOR][Script] Simplify printer configuration and 
display options (#20778)
3baeffbb07 is described below

commit 3baeffbb070ae6dc356bf046b9e2ef2ae3384914
Author: Tianqi Chen <[email protected]>
AuthorDate: Sat Oct 17 17:06:14 2026 -0400

    [REFACTOR][Script] Simplify printer configuration and display options 
(#20778)
    
    Display TVMScript directly with syntax highlighting by removing the
    obsolete Black formatting option and environment switch from the shared
    printer and its wrappers.
    
    Keep dialect-specific type-annotation settings in `extra_config`, place
    that configuration last in printer signatures, and keep TIRx printer
    documentation independent of parent dialects. Preserve the Relax-owned
    Python-module convenience through explicit configuration adaptation.
---
 python/tvm/relax/base_py_module.py                 |  13 +--
 python/tvm/relax/script/printer.py                 |   4 +-
 .../meta_schedule/testing/space_generation.py      |   2 +-
 python/tvm/s_tir/schedule/schedule.py              |   4 +-
 python/tvm/s_tir/schedule/trace.py                 |  14 +--
 .../relax/script/test_relax_script_basic_usage.py  |   6 +-
 .../script/test_relax_script_meta_programming.py   |   2 +-
 .../relax/script/test_relax_script_printer.py      |   8 +-
 tirx/include/tvm/script/printer/config.h           |   4 +-
 tirx/python/tvm_tirx/script/printer/highlight.py   | 103 +--------------------
 tirx/python/tvm_tirx/script/printer/scriptable.py  |  75 ++++-----------
 11 files changed, 38 insertions(+), 197 deletions(-)

diff --git a/python/tvm/relax/base_py_module.py 
b/python/tvm/relax/base_py_module.py
index aa4b1eeb38..d3762559cc 100644
--- a/python/tvm/relax/base_py_module.py
+++ b/python/tvm/relax/base_py_module.py
@@ -18,7 +18,6 @@
 """BasePyModule: Base class for IRModules with Python function support."""
 
 import inspect
-import os
 import sys
 import weakref
 from typing import Any, Optional, Union
@@ -557,6 +556,7 @@ class BasePyModule:
         This method extends the standard IRModule script() method to handle
         Python functions stored in the IRModule's ``__pyfuncs__`` attribute.
         """
+        merged_extra = {"relax.show_all_ty": show_all_ty, **(extra_config or 
{})}
         # First get the standard IRModule script
         base_script = self.ir_mod.script(
             name=name,
@@ -567,8 +567,7 @@ class BasePyModule:
             indent_spaces=indent_spaces,
             print_line_numbers=print_line_numbers,
             num_context_lines=num_context_lines,
-            show_all_ty=show_all_ty,
-            extra_config=extra_config,
+            extra_config=merged_extra,
         )
 
         # If there are no Python functions, return the base script
@@ -635,7 +634,7 @@ class BasePyModule:
 
         return "\n".join(formatted_lines)
 
-    def show(self, style: str | None = None, black_format: bool | None = None, 
**kwargs) -> None:
+    def show(self, style: str | None = None, **kwargs) -> None:
         """A sugar for print highlighted TVM script with Python function 
support.
 
         This method extends the standard IRModule show() method to handle
@@ -645,9 +644,5 @@ class BasePyModule:
             cprint,  # pylint: disable=import-outside-toplevel
         )
 
-        if black_format is None:
-            env = os.environ.get("TVM_BLACK_FORMAT")
-            black_format = env and int(env)
-
         script_content = self.script(**kwargs)
-        cprint(script_content, style=style, black_format=black_format)
+        cprint(script_content, style=style)
diff --git a/python/tvm/relax/script/printer.py 
b/python/tvm/relax/script/printer.py
index 6e19bc442c..057102f294 100644
--- a/python/tvm/relax/script/printer.py
+++ b/python/tvm/relax/script/printer.py
@@ -34,11 +34,11 @@ def _relax_script(
     indent_spaces: int = 4,
     print_line_numbers: bool = False,
     num_context_lines: int = -1,
-    extra_config: dict | None = None,
     path_to_underline: list[AccessPath] | None = None,
     path_to_annotate: dict[AccessPath, str] | None = None,
     obj_to_underline: list[tvm_ffi.Object] | None = None,
     obj_to_annotate: dict[tvm_ffi.Object, str] | None = None,
+    extra_config: dict | None = None,
 ) -> str:
     merged_extra = dict(extra_config or {})
     return tvm_ffi.get_global_func("script.printer.ReprPrintRelax")(
@@ -52,11 +52,11 @@ def _relax_script(
             indent_spaces=indent_spaces,
             print_line_numbers=print_line_numbers,
             num_context_lines=num_context_lines,
-            extra_config=merged_extra,
             path_to_underline=path_to_underline,
             path_to_annotate=path_to_annotate,
             obj_to_underline=obj_to_underline,
             obj_to_annotate=obj_to_annotate,
+            extra_config=merged_extra,
         ),
     )
 
diff --git a/python/tvm/s_tir/meta_schedule/testing/space_generation.py 
b/python/tvm/s_tir/meta_schedule/testing/space_generation.py
index 9a7dbeda54..10b01d77d2 100644
--- a/python/tvm/s_tir/meta_schedule/testing/space_generation.py
+++ b/python/tvm/s_tir/meta_schedule/testing/space_generation.py
@@ -144,7 +144,7 @@ def check_sketches(
 def print_sketches(sketches: list[Schedule]):
     for i, sch in enumerate(sketches):
         print(f"###### {i}")
-        sch.mod.show(black_format=False)
+        sch.mod.show()
         for inst in sch.trace.insts:
             if inst in sch.trace.decisions:
                 print(f'("{inst.kind.name}", {sch.trace.decisions[inst]}),')
diff --git a/python/tvm/s_tir/schedule/schedule.py 
b/python/tvm/s_tir/schedule/schedule.py
index 86d5f58190..cc642c86f6 100644
--- a/python/tvm/s_tir/schedule/schedule.py
+++ b/python/tvm/s_tir/schedule/schedule.py
@@ -290,12 +290,12 @@ class Schedule(tvm_ffi.Object):
 
         trace = self.trace
         if trace is not None:
-            # Trace.show only supports the style and black_format arguments
+            # Trace.show only supports the style argument
             param_binding = inspect.signature(mod.show).bind(*args, **kwargs)
             param_binding.apply_defaults()
             bound_args = param_binding.arguments
 
-            trace.show(style=bound_args["style"], 
black_format=bound_args["black_format"])
+            trace.show(style=bound_args["style"])
 
     ########## Lookup ##########
 
diff --git a/python/tvm/s_tir/schedule/trace.py 
b/python/tvm/s_tir/schedule/trace.py
index a8622a105a..180ab88abb 100644
--- a/python/tvm/s_tir/schedule/trace.py
+++ b/python/tvm/s_tir/schedule/trace.py
@@ -16,7 +16,6 @@
 # under the License.
 """An execution trace of a scheduling program"""
 
-import os
 from collections.abc import Callable
 from typing import TYPE_CHECKING, Any
 
@@ -269,7 +268,7 @@ class Trace(tvm_ffi.Object):
         """
         _ffi_api.TraceApplyJSONToSchedule(json_obj, sch)  # type: ignore # 
pylint: disable=no-member
 
-    def show(self, style: str | None = None, black_format: bool = False) -> 
None:
+    def show(self, style: str | None = None) -> None:
         """A sugar for print highlighted TVM script.
 
         Parameters
@@ -279,18 +278,9 @@ class Trace(tvm_ffi.Object):
             Pygmentize printing style, auto-detected if None.  See
             `tvm_tirx.script.printer.highlight.cprint` for more details.
 
-        black_format: bool
-
-            If true, use the formatter Black to format the TVMScript.
-            If None, determine based on the "TVM_BLACK_FORMAT" environment
-            variable.
         """
         from tvm_tirx.script.printer.highlight import (  # pylint: 
disable=import-outside-toplevel
             cprint,
         )
 
-        if black_format is None:
-            env = os.environ.get("TVM_BLACK_FORMAT")
-            black_format = bool(env and int(env))
-
-        cprint(str(self), style=style, black_format=black_format)
+        cprint(str(self), style=style)
diff --git a/tests/python/relax/script/test_relax_script_basic_usage.py 
b/tests/python/relax/script/test_relax_script_basic_usage.py
index 64bdeb4dbc..8b0e259884 100644
--- a/tests/python/relax/script/test_relax_script_basic_usage.py
+++ b/tests/python/relax/script/test_relax_script_basic_usage.py
@@ -1421,7 +1421,7 @@ def test_primitive_assignments_emit_fresh_bindings():
         assert tvm_tirx.ir.is_prim_expr(binding.value)
         assert not isinstance(binding.value, tvm_tirx.ir.GenericConst)
 
-    source = func.script(show_all_ty=False)
+    source = func.script(extra_config={"relax.show_all_ty": False})
     assert "R.prim_value" not in source
     for annotation in [
         "alias: T.int64",
@@ -1457,7 +1457,7 @@ def test_primitive_if_emits_fresh_result():
         assert not branch.blocks
         assert branch.body.same_as(param)
 
-    source = func.script(show_all_ty=False)
+    source = func.script(extra_config={"relax.show_all_ty": False})
     assert "R.prim_value" not in source
     assert source.count("output: T.int64") == 2
     _check(func)
@@ -1575,7 +1575,7 @@ def test_tuple_literals_preserve_expression_structure():
 
     tvm_tirx.ir.assert_structural_equal(literal, constructed)
     for show_all_ty in [False, True]:
-        source = literal.script(show_all_ty=show_all_ty)
+        source = literal.script(extra_config={"relax.show_all_ty": 
show_all_ty})
         assert "R.tuple" not in source
         tvm_tirx.ir.assert_structural_equal(
             literal, tvm_tirx.script.from_source(source, extra_vars={"I": I, 
"R": R, "T": T})
diff --git a/tests/python/relax/script/test_relax_script_meta_programming.py 
b/tests/python/relax/script/test_relax_script_meta_programming.py
index df67887f01..a56e5fc490 100644
--- a/tests/python/relax/script/test_relax_script_meta_programming.py
+++ b/tests/python/relax/script/test_relax_script_meta_programming.py
@@ -455,7 +455,7 @@ def test_shared_meta_var_uses_ordinary_relax_bindings():
     assert not via_i.var.same_as(via_i.value)
     assert not via_t.var.same_as(via_t.value)
     assert func.body.body.same_as(output.var)
-    source = func.script(show_all_ty=False)
+    source = func.script(extra_config={"relax.show_all_ty": False})
     assert "meta_var" not in source
     _check(func)
 
diff --git a/tests/python/relax/script/test_relax_script_printer.py 
b/tests/python/relax/script/test_relax_script_printer.py
index 08127d1779..2862600443 100644
--- a/tests/python/relax/script/test_relax_script_printer.py
+++ b/tests/python/relax/script/test_relax_script_printer.py
@@ -621,7 +621,7 @@ def 
test_primitive_bindings_roundtrip_without_prim_value_marker():
         return alias
 
     for show_all_ty in [False, True]:
-        source = func.script(show_all_ty=show_all_ty)
+        source = func.script(extra_config={"relax.show_all_ty": show_all_ty})
         assert "R.prim_value" not in source
         assert "plus_one: T.int64" in source
         assert "alias: T.int64" in source
@@ -1215,7 +1215,7 @@ def func(x: R.Tensor((128, 128), dtype="float32")) -> 
R.Tensor((128, 128), dtype
 def test_hide_inferable_ty():
     """Redundant type annotations can be omitted
 
-    When `show_all_ty=False`, TVMScript type annotations that
+    When `extra_config={"relax.show_all_ty": False}`, TVMScript type 
annotations that
     provide redundant type can be omitted.
     """
 
@@ -1247,7 +1247,7 @@ def test_hide_inferable_ty():
         return E
 
     _assert_print_lines(
-        func.script(show_all_ty=False),
+        func.script(extra_config={"relax.show_all_ty": False}),
         """
 from __future__ import annotations
 
@@ -1285,7 +1285,7 @@ def relax_extern_func():
 def test_extern_func_roundtrip(show_all_ty):
     original = relax_extern_func()
     after_roundtrip = tvm_tirx.script.from_source(
-        original.script(show_meta=True, show_all_ty=show_all_ty),
+        original.script(show_meta=True, extra_config={"relax.show_all_ty": 
show_all_ty}),
         extra_vars={
             "I": tvm_tirx.script.ir,
             "T": tvm_tirx.script.tirx,
diff --git a/tirx/include/tvm/script/printer/config.h 
b/tirx/include/tvm/script/printer/config.h
index dfb9dbbe40..440ca25b6b 100644
--- a/tirx/include/tvm/script/printer/config.h
+++ b/tirx/include/tvm/script/printer/config.h
@@ -73,8 +73,6 @@ class PrinterConfigObj : public ffi::Object {
    * Keys are conventionally namespaced as "<dialect>.<knob>", e.g.:
    *   "ir.prefix"                — the IR prefix (default "I")
    *   "tirx.prefix"              — the TIR prefix (default "T")
-   *   "relax.prefix"             — the Relax prefix (default "R")
-   *   "relax.show_all_ty" — whether to show all Relax type annotations 
(default true)
    *
    * Use GetExtraConfig<T>(key, fallback) to read values with a typed fallback.
    */
@@ -84,7 +82,7 @@ class PrinterConfigObj : public ffi::Object {
    * \brief Look up a value in extra_config with type cast and fallback.
    *
    * Keys are conventionally namespaced as "<dialect>.<knob>"
-   * (e.g. "tirx.prefix", "relax.show_all_ty").
+   * (e.g. "ir.prefix", "tirx.prefix").
    */
   template <typename T>
   T GetExtraConfig(const ffi::String& key, T fallback) const {
diff --git a/tirx/python/tvm_tirx/script/printer/highlight.py 
b/tirx/python/tvm_tirx/script/printer/highlight.py
index 0abb3d82e4..603b949793 100644
--- a/tirx/python/tvm_tirx/script/printer/highlight.py
+++ b/tirx/python/tvm_tirx/script/printer/highlight.py
@@ -17,10 +17,7 @@
 # ruff: noqa: F821, RUF012
 """Highlight printed TVM script."""
 
-import functools
 import os
-import shutil
-import subprocess
 import sys
 import warnings
 from typing import Any, Union
@@ -29,9 +26,8 @@ from typing import Any, Union
 def cprint(
     printable: Any | str,
     style: str | None = None,
-    black_format: bool = False,
 ) -> None:
-    """Print TVMScript string with Pygments highlight and Black 
auto-formatting.
+    """Print TVMScript string with Pygments highlighting.
 
     Parameters
     ----------
@@ -43,10 +39,6 @@ def cprint(
 
         Pygmentize printing style, auto-detected if None.
 
-    black_format: bool
-
-        If true, use the formatter Black to format the TVMScript
-
     Notes
     -----
 
@@ -68,9 +60,6 @@ def cprint(
             f"Only can print strings or objects with `script` method, but got: 
{type(printable)}"
         )
 
-    if black_format:
-        printable = _format(printable)
-
     is_in_notebook = "ipykernel" in sys.modules  # in notebook env (support 
html display).
 
     style = _get_pygments_style(style, is_in_notebook)
@@ -95,96 +84,6 @@ def cprint(
         print(highlight(printable, Python3Lexer(), 
Terminal256Formatter(style=style)))
 
 
[email protected]_cache
-def _get_formatter(formatter: str | None = None):
-    def get_ruff_formatter():
-        if shutil.which("ruff") is None:
-            return None
-
-        def formatter(code_str):
-            proc = subprocess.Popen(
-                ["ruff", "format", "--stdin-filename=TVMScript"],
-                stdin=subprocess.PIPE,
-                stdout=subprocess.PIPE,
-                encoding="utf-8",
-            )
-            stdout, _stderr = proc.communicate(code_str)
-            return stdout
-
-        return formatter
-
-    def get_black_formatter():
-        try:
-            # pylint: disable=import-outside-toplevel
-            import black
-        except ImportError:
-            return None
-
-        def formatter(code_str):
-            return black.format_str(code_str, mode=black.FileMode())
-
-        return formatter
-
-    def get_fallback_formatter():
-        def formatter(code_str):
-            with warnings.catch_warnings():
-                warnings.simplefilter("once", UserWarning)
-                ruff_install_cmd = sys.executable + " -m pip install ruff"
-                black_install_cmd = (
-                    sys.executable + ' -m pip install "black==22.3.0" 
--upgrade --user'
-                )
-                warnings.warn(
-                    f"Neither the 'ruff' formatter nor the 'black' formatter 
is available.  "
-                    f"To print formatted TVM script, please a formatter.  \n"
-                    f"To install ruff: {ruff_install_cmd}\n"
-                    f"To install black: {black_install_cmd}",
-                    category=UserWarning,
-                )
-            return code_str
-
-        return formatter
-
-    # formatter = "black"
-    if formatter is None:
-        options = [get_ruff_formatter, get_black_formatter]
-    elif formatter == "ruff":
-        options = [get_ruff_formatter]
-    elif formatter == "black":
-        options = [get_black_formatter]
-    else:
-        raise ValueError(f"Unknown formatter: {formatter}")
-
-    for option in options:
-        func = option()
-        if func is not None:
-            return func
-    return get_fallback_formatter()
-
-
-def _format(code_str: str, formatter: str | None = None) -> str:
-    """Format a code string using Black.
-
-    Parameters
-    ----------
-    code_str: str
-
-        The string containing Python/TVMScript code to format
-
-    formatter: Optional[str]
-
-        The formatter to use.  Can specify `ruff`, `black`, or
-        auto-select by passing `None`.
-
-    Returns
-    -------
-    formatted: str
-
-        The formatted Python/TVMScript code
-
-    """
-    return _get_formatter(formatter)(code_str)
-
-
 def _get_pygments_style(
     style: str | None, is_in_notebook: bool
 ) -> Union["pygments.style.Style", str] | None:
diff --git a/tirx/python/tvm_tirx/script/printer/scriptable.py 
b/tirx/python/tvm_tirx/script/printer/scriptable.py
index c6823ccbad..e958253b35 100644
--- a/tirx/python/tvm_tirx/script/printer/scriptable.py
+++ b/tirx/python/tvm_tirx/script/printer/scriptable.py
@@ -16,7 +16,6 @@
 # under the License.
 """Configuration of TVMScript printer"""
 
-import os
 from collections.abc import Sequence
 
 import tvm_ffi
@@ -43,11 +42,11 @@ class PrinterConfig(tvm_ffi.Object):
     indent_spaces: int
     print_line_numbers: bool
     num_context_lines: int
-    extra_config: dict
     path_to_underline: list[AccessPath] | None
     path_to_annotate: dict[AccessPath, str] | None
-    obj_to_underline: list[AccessPath] | None
-    obj_to_annotate: dict[AccessPath, str] | None
+    obj_to_underline: list[tvm_ffi.Object] | None
+    obj_to_annotate: dict[tvm_ffi.Object, str] | None
+    extra_config: dict
 
     def __init__(
         self,
@@ -60,12 +59,11 @@ class PrinterConfig(tvm_ffi.Object):
         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[tvm_ffi.Object] | None = None,
         obj_to_annotate: dict[tvm_ffi.Object, str] | None = None,
+        extra_config: dict | None = None,
     ) -> None:
         if num_context_lines is None:
             num_context_lines = -1
@@ -81,8 +79,6 @@ class PrinterConfig(tvm_ffi.Object):
             "path_to_annotate": path_to_annotate,
             "obj_to_underline": obj_to_underline,
             "obj_to_annotate": obj_to_annotate,
-            # Dialect-specific config via dotted keys in extra_config
-            "relax.show_all_ty": show_all_ty,
         }
 
         if name is not None:
@@ -113,12 +109,11 @@ class _ScriptableMethods:
         indent_spaces: int = 4,
         print_line_numbers: bool = False,
         num_context_lines: int = -1,
-        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[tvm_ffi.Object] | None = None,
         obj_to_annotate: dict[tvm_ffi.Object, str] | None = None,
+        extra_config: dict | None = None,
     ) -> str:
         """Print TVM IR into TVMScript text format
 
@@ -140,15 +135,6 @@ class _ScriptableMethods:
             Whether to print line numbers
         num_context_lines : int = -1
             The number of lines of context to print before and after the line 
to underline.
-        show_all_ty: bool = True
-            If True (default), annotate all variable bindings with the struct
-            info of that variable.  If False, only add annotations where
-            required for unambiguous round-trip of Relax -> TVMScript -> Relax.
-        extra_config : Optional[dict] = None
-            Dialect-specific configuration passed through to 
PrinterConfig.extra_config,
-            including ``ir.prefix`` for the IR namespace alias (default 
``"I"``).
-            Keys are conventionally namespaced as "<dialect>.<knob>", e.g.
-            ``{"tirx.prefix": "T"}``.
         path_to_underline : Optional[List[AccessPath]] = None
             Object path to be underlined
         path_to_annotate : Optional[Dict[AccessPath, str]] = None
@@ -157,6 +143,11 @@ class _ScriptableMethods:
             Object to be underlined
         obj_to_annotate : Optional[Dict[tvm_ffi.Object, str]] = None
             Object to be annotated
+        extra_config : Optional[dict] = None
+            Dialect-specific configuration passed through to 
PrinterConfig.extra_config,
+            including ``ir.prefix`` for the IR namespace alias (default 
``"I"``).
+            Keys are conventionally namespaced as "<dialect>.<knob>", e.g.
+            ``{"tirx.prefix": "T"}``.
 
         Returns
         -------
@@ -182,19 +173,17 @@ class _ScriptableMethods:
                 indent_spaces=indent_spaces,
                 print_line_numbers=print_line_numbers,
                 num_context_lines=num_context_lines,
-                show_all_ty=show_all_ty,
-                extra_config=merged_extra if merged_extra else None,
                 path_to_underline=path_to_underline,
                 path_to_annotate=path_to_annotate,
                 obj_to_underline=obj_to_underline,
                 obj_to_annotate=obj_to_annotate,
+                extra_config=merged_extra,
             ),
         )
 
     def show(
         self,
         style: str | None = None,
-        black_format: bool | None = None,
         *,
         name: str | None = None,
         show_meta: bool = False,
@@ -204,14 +193,13 @@ class _ScriptableMethods:
         indent_spaces: int = 4,
         print_line_numbers: bool = False,
         num_context_lines: int = -1,
-        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[tvm_ffi.Object] | None = None,
         obj_to_annotate: dict[tvm_ffi.Object, str] | None = None,
+        extra_config: dict | None = None,
     ) -> None:
-        """A sugar for print highlighted TVM script.
+        """Print highlighted TVMScript.
 
         Parameters
         ----------
@@ -219,25 +207,6 @@ class _ScriptableMethods:
             Pygmentize printing style, auto-detected if None.  See
             `tvm_tirx.script.printer.highlight.cprint` for more details.
 
-        black_format: Optional[bool]
-
-            If true, use the formatter Black to format the TVMScript.
-            If false, do not apply the auto-formatter.
-
-            If None (default), determine the behavior based on the
-            environment variable "TVM_BLACK_FORMAT".  If this
-            environment variable is unset, set to the empty string, or
-            set to the integer zero, black auto-formatting will be
-            disabled.  If the environment variable is set to a
-            non-zero integer, black auto-formatting will be enabled.
-
-            Note that the "TVM_BLACK_FORMAT" environment variable only
-            applies to the `.show()` method, and not the underlying
-            `.script()` method.  The `.show()` method is intended for
-            human-readable output based on individual user
-            preferences, while the `.script()` method is intended to
-            provided a consistent output regardless of environment.
-
         name : Optional[str] = None
             The name of the object
         show_meta : bool = False
@@ -254,13 +223,6 @@ class _ScriptableMethods:
             Whether to print line numbers
         num_context_lines : int = -1
             The number of lines of context to print before and after the line 
to underline.
-        show_all_ty: bool = True
-            If True (default), annotate all variable bindings with the struct
-            info of that variable.  If False, only add annotations where
-            required for unambiguous round-trip of Relax -> TVMScript -> Relax.
-        extra_config : Optional[dict] = None
-            Dialect-specific configuration passed through to 
PrinterConfig.extra_config,
-            including ``ir.prefix`` for the IR namespace alias (default 
``"I"``).
         path_to_underline : Optional[List[AccessPath]] = None
             Object path to be underlined
         path_to_annotate : Optional[Dict[AccessPath, str]] = None
@@ -269,16 +231,15 @@ class _ScriptableMethods:
             Object to be underlined
         obj_to_annotate : Optional[Dict[tvm_ffi.Object, str]] = None
             Object to be annotated
+        extra_config : Optional[dict] = None
+            Dialect-specific configuration passed through to 
PrinterConfig.extra_config,
+            including ``ir.prefix`` for the IR namespace alias (default 
``"I"``).
 
         """
         from tvm_tirx.script.printer.highlight import (
             cprint,  # pylint: disable=import-outside-toplevel
         )
 
-        if black_format is None:
-            env = os.environ.get("TVM_BLACK_FORMAT")
-            black_format = env and int(env)
-
         cprint(
             self.script(
                 name=name,
@@ -289,15 +250,13 @@ class _ScriptableMethods:
                 indent_spaces=indent_spaces,
                 print_line_numbers=print_line_numbers,
                 num_context_lines=num_context_lines,
-                show_all_ty=show_all_ty,
-                extra_config=extra_config,
                 path_to_underline=path_to_underline,
                 path_to_annotate=path_to_annotate,
                 obj_to_underline=obj_to_underline,
                 obj_to_annotate=obj_to_annotate,
+                extra_config=extra_config,
             ),
             style=style,
-            black_format=black_format,
         )
 
 

Reply via email to