[BE][PYFMT] migrate PYFMT for torch/[p-z]*/ to ruff format (#144552)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/144552
Approved by: https://github.com/ezyang
This commit is contained in:
Xuehai Pan
2025-08-06 20:57:29 +00:00
committed by PyTorch MergeBot
parent fd606a3a91
commit 5cedc5a0ff
65 changed files with 446 additions and 522 deletions

View File

@ -6,6 +6,7 @@ If you are adding a new entry/functionality, please, add it to the
`torch/ao/quantization/fuser_method_mappings.py`, while adding an import statement
here.
"""
from torch.ao.quantization.fuser_method_mappings import (
_DEFAULT_OP_LIST_TO_FUSER_METHOD,
fuse_conv_bn,

View File

@ -6,6 +6,7 @@ If you are adding a new entry/functionality, please, add it to the
appropriate files under `torch/ao/quantization/fx/`, while adding an import statement
here.
"""
from torch.ao.quantization.fx._equalize import (
_convert_equalization_ref,
_InputEqualizationObserver,

View File

@ -6,4 +6,5 @@ If you are adding a new entry/functionality, please, add it to the
appropriate files under `torch/ao/quantization/fx/`, while adding an import statement
here.
"""
from torch.ao.quantization.fx.convert import convert

View File

@ -6,4 +6,5 @@ If you are adding a new entry/functionality, please, add it to the
appropriate files under `torch/ao/quantization/fx/`, while adding an import statement
here.
"""
from torch.ao.quantization.fx.fuse import fuse

View File

@ -6,4 +6,5 @@ If you are adding a new entry/functionality, please, add it to the
appropriate files under `torch/ao/quantization/fx/`, while adding an import statement
here.
"""
from torch.ao.quantization.fx.fuse_handler import DefaultFuseHandler, FuseHandler

View File

@ -6,6 +6,7 @@ If you are adding a new entry/functionality, please, add it to the
appropriate files under `torch/ao/quantization/fx/`, while adding an import statement
here.
"""
from torch.ao.quantization.fx.graph_module import (
_is_observed_module,
_is_observed_standalone_module,

View File

@ -6,6 +6,7 @@ If you are adding a new entry/functionality, please, add it to the
appropriate files under `torch/ao/quantization/fx/`, while adding an import statement
here.
"""
from torch.ao.quantization.fx.match_utils import (
_find_matches,
_is_match,

View File

@ -6,6 +6,7 @@ If you are adding a new entry/functionality, please, add it to the
appropriate files under `torch/ao/quantization/fx/`, while adding an import statement
here.
"""
from torch.ao.quantization.fx.pattern_utils import (
_register_fusion_pattern,
_register_quant_pattern,

View File

@ -6,4 +6,5 @@ If you are adding a new entry/functionality, please, add it to the
appropriate files under `torch/ao/quantization/fx/`, while adding an import statement
here.
"""
from torch.ao.quantization.fx.prepare import prepare

View File

@ -6,6 +6,7 @@ If you are adding a new entry/functionality, please, add it to the
appropriate files under `torch/ao/quantization/fx/`, while adding an import statement
here.
"""
from torch.ao.quantization.fx.quantize_handler import (
BatchNormQuantizeHandler,
BinaryOpQuantizeHandler,

View File

@ -6,4 +6,5 @@ If you are adding a new entry/functionality, please, add it to the
appropriate files under `torch/ao/quantization/fx/`, while adding an import statement
here.
"""
from torch.ao.quantization.utils import Pattern, QuantizerCls

View File

@ -6,6 +6,7 @@ If you are adding a new entry/functionality, please, add it to the
appropriate files under `torch/ao/quantization/fx/`, while adding an import statement
here.
"""
from torch.ao.quantization.fx.utils import (
all_node_args_have_no_tensors,
assert_and_get_unique_device,

View File

@ -6,6 +6,7 @@ If you are adding a new entry/functionality, please, add it to the
`torch/ao/quantization/observer.py`, while adding an import statement
here.
"""
from torch.ao.quantization.observer import (
_is_activation_post_process,
_is_per_channel_script_obs_instance,

View File

@ -6,6 +6,7 @@ If you are adding a new entry/functionality, please, add it to the
`torch/ao/quantization/qconfig.py`, while adding an import statement
here.
"""
from torch.ao.quantization.qconfig import (
_add_module_to_qconfig_obs_ctr,
_assert_valid_qconfig,

View File

@ -6,6 +6,7 @@ If you are adding a new entry/functionality, please, add it to the
`torch/ao/quantization/quantization_mappings.py`, while adding an import statement
here.
"""
from torch.ao.quantization.quantization_mappings import (
_get_special_act_post_process,
_has_special_act_post_process,