Fix per file ruff ignores related to simplification (#26259)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
Harry Mellor
2025-10-05 20:31:53 +00:00
committed by GitHub
parent 6b6e98775f
commit b893d661b1
32 changed files with 47 additions and 191 deletions
@@ -502,15 +502,11 @@ class CompressedTensorsConfig(QuantizationConfig):
QuantizationStrategy.CHANNEL,
QuantizationStrategy.BLOCK,
]
if not (
return (
is_symmetric_weight
and is_static_weight # noqa: SIM103
and is_static_weight
and is_tensor_or_channel_or_block_weight
):
return False
# All conditions satisfied.
return True
)
def _is_wNa16_group_channel(
self, weight_quant: QuantizationArgs, input_quant: QuantizationArgs
@@ -80,10 +80,7 @@ def check_equal_or_regex_match(layer_name: str, targets: Iterable[str]) -> bool:
Checks whether a layer_name is exactly equal or a regex match for
if target starts with 're:' to any target in list.
"""
for target in targets:
if _is_equal_or_regex_match(layer_name, target):
return True
return False
return any(_is_equal_or_regex_match(layer_name, target) for target in targets)
def find_matched_target(
@@ -81,10 +81,7 @@ def check_equal_or_regex_match(layer_name: str, targets: Iterable[str]) -> bool:
Checks whether a layer_name is exactly equal or a regex match for
if target starts with 're:' to any target in list.
"""
for target in targets:
if _is_equal_or_regex_match(layer_name, target):
return True
return False
return any(_is_equal_or_regex_match(layer_name, target) for target in targets)
def _is_equal_or_regex_match(