diff --git a/.flake8 b/.flake8 index 5da4f8e575eaaa..5d69dc54fd1a4d 100644 --- a/.flake8 +++ b/.flake8 @@ -14,7 +14,7 @@ ignore = # to line this up with executable bit EXE001, # these ignores are from flake8-bugbear; please fix! - B007,B008,B017,B019,B023,B026,B028,B903,B904,B905,B906,B907 + B007,B008,B017,B019,B023,B028,B903,B904,B905,B906,B907 # these ignores are from flake8-comprehensions; please fix! C407, # these ignores are from flake8-logging-format; please fix! diff --git a/pyproject.toml b/pyproject.toml index 3585c372018f02..076bc91bd56137 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,7 @@ ignore = [ "B007", "B008", "B017", "B018", # Useless expression "B019", - "B023", "B026", + "B023", "B028", # No explicit `stacklevel` keyword argument found "B904", "E402", diff --git a/test/distributed/fsdp/test_fsdp_checkpoint.py b/test/distributed/fsdp/test_fsdp_checkpoint.py index 7f99d95af24153..57708a94acb1ff 100644 --- a/test/distributed/fsdp/test_fsdp_checkpoint.py +++ b/test/distributed/fsdp/test_fsdp_checkpoint.py @@ -100,7 +100,7 @@ def __init__( l3 = ckpt_wrapper(l3) fsdp_wrapper = partial( - _maybe_wrap_fsdp, wrap_fsdp=wrap_fsdp, *fsdp_args, **fsdp_kwargs + _maybe_wrap_fsdp, *fsdp_args, wrap_fsdp=wrap_fsdp, **fsdp_kwargs ) self.ffn = nn.Sequential( fsdp_wrapper(l1), diff --git a/test/distributed/fsdp/test_fsdp_state_dict.py b/test/distributed/fsdp/test_fsdp_state_dict.py index 3bdd5b4da00382..de4ae8b0e646b1 100644 --- a/test/distributed/fsdp/test_fsdp_state_dict.py +++ b/test/distributed/fsdp/test_fsdp_state_dict.py @@ -230,8 +230,8 @@ def _get_multibuffer_nested_model( bn1 = checkpoint_wrapper(bn1) lin2 = checkpoint_wrapper(lin2) seq = nn.Sequential( - FSDP(lin1, mixed_precision=lin_mp, *fsdp_args, **fsdp_kwargs), - FSDP(bn1, mixed_precision=bn_mp, *fsdp_args, **fsdp_kwargs), + FSDP(lin1, *fsdp_args, mixed_precision=lin_mp, **fsdp_kwargs), + FSDP(bn1, *fsdp_args, mixed_precision=bn_mp, **fsdp_kwargs), lin2, ) if checkpoint_wrap: diff --git a/test/onnx/test_operators.py b/test/onnx/test_operators.py index c0861a9c32fcbd..d456c6a30cf8c2 100644 --- a/test/onnx/test_operators.py +++ b/test/onnx/test_operators.py @@ -48,7 +48,7 @@ def export_to_pbtxt(model, inputs, *args, **kwargs): return torch.onnx.export_to_pretty_string( - model, inputs, google_printer=True, *args, **kwargs + model, inputs, *args, google_printer=True, **kwargs ) diff --git a/test/test_ops.py b/test/test_ops.py index 017854439ed107..14e327a39e27b4 100644 --- a/test/test_ops.py +++ b/test/test_ops.py @@ -986,7 +986,7 @@ def helper(with_out, expectFail, op_to_test, inputs, *args, **kwargs): try: if with_out: out = torch.empty(0, dtype=torch.int32, device=device) - op_to_test(inputs, out=out, *args, **kwargs) + op_to_test(inputs, *args, out=out, **kwargs) else: out = op_to_test(inputs, *args, **kwargs) self.assertFalse(expectFail) diff --git a/torch/_functorch/aot_autograd.py b/torch/_functorch/aot_autograd.py index b9f82270c1541f..4fc58d405f69a9 100644 --- a/torch/_functorch/aot_autograd.py +++ b/torch/_functorch/aot_autograd.py @@ -4716,7 +4716,7 @@ def functional_call(named_params, named_buffers, *args, **kwargs): named_buffers = dict(mod.named_buffers(remove_duplicate=False)) num_params_buffers = len(named_params) + len(named_buffers) compiled_f = aot_function( - functional_call, num_params_buffers=num_params_buffers, *args, **kwargs + functional_call, *args, num_params_buffers=num_params_buffers, **kwargs ) class AOTModule(nn.Module): diff --git a/torch/utils/data/datapipes/iter/combinatorics.py b/torch/utils/data/datapipes/iter/combinatorics.py index fc2f5c68e97f7d..16d2f5444dcd9e 100644 --- a/torch/utils/data/datapipes/iter/combinatorics.py +++ b/torch/utils/data/datapipes/iter/combinatorics.py @@ -40,7 +40,7 @@ def __init__(self, self.sampler_args = () if sampler_args is None else sampler_args self.sampler_kwargs = {} if sampler_kwargs is None else sampler_kwargs # https://github.com/python/mypy/pull/9629 will solve - self.sampler = sampler(data_source=self.datapipe, *self.sampler_args, **self.sampler_kwargs) # type: ignore[misc] + self.sampler = sampler(*self.sampler_args, data_source=self.datapipe, **self.sampler_kwargs) # type: ignore[misc] def __iter__(self) -> Iterator[T_co]: return iter(self.sampler)