Skip to content

Commit 12cb265

Browse files
huydhnpytorchmergebot
authored andcommitted
Apply ufmt to torch internal (pytorch#81643)
This is a big bang PR, merge conflicts are probably expected and will be addressed at merge. Pull Request resolved: pytorch#81643 Approved by: https://github.com/ezyang
1 parent f595467 commit 12cb265

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+8343
-4469
lines changed

.lintrunner.toml

+8
Original file line numberDiff line numberDiff line change
@@ -689,6 +689,13 @@ code = 'UFMT'
689689
include_patterns = [
690690
'test/onnx/**/*.py',
691691
'tools/**/*.py',
692+
'torch/_decomp/**/*.py',
693+
'torch/_lazy/**/*.py',
694+
'torch/_masked/**/*.py',
695+
'torch/_prims/**/*.py',
696+
'torch/_refs/**/*.py',
697+
'torch/_subclasses/**/*.py',
698+
'torch/_*.py',
692699
'torchgen/**/*.py',
693700
]
694701
command = [
@@ -699,6 +706,7 @@ command = [
699706
]
700707
exclude_patterns = [
701708
'tools/gen_vulkan_spv.py',
709+
'torch/__init__.py', # Skip this file to format because it's part of the public API
702710
]
703711
init_command = [
704712
'python3',

torch/_VF.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@
1010
introducing torch._VF
1111
1212
"""
13-
import torch
1413
import sys
1514
import types
1615

16+
import torch
17+
1718

1819
class VFModule(types.ModuleType):
1920
vf: types.ModuleType

torch/__config__.py

+2
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@ def show():
88
"""
99
return torch._C._show_config()
1010

11+
1112
# TODO: In principle, we could provide more structured version/config
1213
# information here. For now only CXX_FLAGS is exposed, as Timer
1314
# uses them.
1415
def _cxx_flags():
1516
"""Returns the CXX_FLAGS used when building PyTorch."""
1617
return torch._C._cxx_flags()
1718

19+
1820
def parallel_info():
1921
r"""Returns detailed string with parallelization settings"""
2022
return torch._C._parallel_info()

torch/__future__.py

+2
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@
1111
"""
1212
_overwrite_module_params_on_conversion = False
1313

14+
1415
def set_overwrite_module_params_on_conversion(value):
1516
global _overwrite_module_params_on_conversion
1617
_overwrite_module_params_on_conversion = value
1718

19+
1820
def get_overwrite_module_params_on_conversion():
1921
return _overwrite_module_params_on_conversion

0 commit comments

Comments
 (0)