From 484995f9b2fd7a1c52f296f2f7b5493f94ca5b3e Mon Sep 17 00:00:00 2001 From: drisspg Date: Mon, 3 Feb 2025 15:43:17 -0800 Subject: [PATCH] Fix ruff and make sure pre-commit is at same version stack-info: PR: https://github.com/pytorch/ao/pull/1658, branch: drisspg/stack/32 --- .pre-commit-config.yaml | 2 +- torchao/quantization/quant_api.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3e34f1d465..79824e1061 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,7 +11,7 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.5.6 + rev: v0.6.8 hooks: # Run the linter. - id: ruff diff --git a/torchao/quantization/quant_api.py b/torchao/quantization/quant_api.py index bbe9b1cb6b..7154957a21 100644 --- a/torchao/quantization/quant_api.py +++ b/torchao/quantization/quant_api.py @@ -450,7 +450,9 @@ def _linear_extra_repr(self): return f"in_features={self.weight.shape[1]}, out_features={self.weight.shape[0]}, weight={_quantization_type(self.weight)}" -def _get_linear_subclass_inserter(constructor, *, allow_requires_grad=False, propagate_bias=False, **kwargs): +def _get_linear_subclass_inserter( + constructor, *, allow_requires_grad=False, propagate_bias=False, **kwargs +): """Helper function to apply the constructor that quantizes the weight Tensor (with additional kwargs) to the weight of linear module """