Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TVMScript] Disable black_format by default #15706

Merged
merged 1 commit into from
Sep 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions python/tvm/runtime/script_printer.py
Original file line number Diff line number Diff line change
@@ -199,7 +199,7 @@ def script(
def show(
self,
style: Optional[str] = None,
black_format: bool = True,
black_format: bool = False,
*,
name: Optional[str] = None,
show_meta: bool = False,
@@ -227,7 +227,7 @@ def show(
Pygmentize printing style, auto-detected if None. See
`tvm.script.highlight.cprint` for more details.
black_format: bool
If true (default), use the formatter Black to format the TVMScript
If true, use the formatter Black to format the TVMScript
name : Optional[str] = None
The name of the object
show_meta : bool = False
4 changes: 2 additions & 2 deletions python/tvm/script/highlight.py
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@
def cprint(
printable: Union[Any, str],
style: Optional[str] = None,
black_format: bool = True,
black_format: bool = False,
) -> None:
"""Print TVMScript string with Pygments highlight and Black auto-formatting.
@@ -42,7 +42,7 @@ def cprint(
black_format: bool
If true (default), use the formatter Black to format the TVMScript
If true, use the formatter Black to format the TVMScript
Notes
-----
4 changes: 2 additions & 2 deletions python/tvm/tir/schedule/schedule.py
Original file line number Diff line number Diff line change
@@ -268,7 +268,7 @@ def fork_seed(self) -> int:
"""
return _ffi_api.ScheduleForkSeed(self) # type: ignore # pylint: disable=no-member

def show(self, style: Optional[str] = None, black_format: bool = True) -> None:
def show(self, style: Optional[str] = None, black_format: bool = False) -> None:
"""A sugar for print highlighted TVM script.
Parameters
@@ -280,7 +280,7 @@ def show(self, style: Optional[str] = None, black_format: bool = True) -> None:
black_format: bool
If true (default), use the formatter Black to format the TVMScript
If true, use the formatter Black to format the TVMScript
"""
mod = self.mod
if mod is not None:
4 changes: 2 additions & 2 deletions python/tvm/tir/schedule/trace.py
Original file line number Diff line number Diff line change
@@ -262,7 +262,7 @@ def apply_json_to_schedule(json_obj: JSON_TYPE, sch: "Schedule") -> None:
"""
_ffi_api.TraceApplyJSONToSchedule(json_obj, sch) # type: ignore # pylint: disable=no-member

def show(self, style: Optional[str] = None, black_format: bool = True) -> None:
def show(self, style: Optional[str] = None, black_format: bool = False) -> None:
"""A sugar for print highlighted TVM script.
Parameters
@@ -274,7 +274,7 @@ def show(self, style: Optional[str] = None, black_format: bool = True) -> None:
black_format: bool
If true (default), use the formatter Black to format the TVMScript
If true, use the formatter Black to format the TVMScript
"""
from tvm.script.highlight import ( # pylint: disable=import-outside-toplevel
cprint,