mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Enable all PIE rules on ruff (#165814)
This PR enables all PIE rules on ruff, there are already some enabled rules from this family, the new added rules are ``` PIE796 Enum contains duplicate value: {value} PIE808 Unnecessary start argument in range ``` Pull Request resolved: https://github.com/pytorch/pytorch/pull/165814 Approved by: https://github.com/ezyang
This commit is contained in:
committed by
PyTorch MergeBot
parent
e595136187
commit
c79dfdc655
@ -85,7 +85,7 @@ class WeightOnlyInt8QuantHandler:
|
||||
cur_state_dict[f"{fqn}.weight"] = int8_weight
|
||||
cur_state_dict[f"{fqn}.scales"] = scales.to(mod.weight.dtype)
|
||||
elif isinstance(mod, ConditionalFeedForward):
|
||||
for weight_idx in range(0, 3):
|
||||
for weight_idx in range(3):
|
||||
weight_name = f"w{weight_idx + 1}"
|
||||
scales_name = f"scales{weight_idx + 1}"
|
||||
weight = getattr(mod, weight_name)
|
||||
|
Reference in New Issue
Block a user