Skip to content

Commit c1e45e8

Browse files
authored
Remove all references to pylint (#293)
* Remove all references to pylint
1 parent f72ff1f commit c1e45e8

File tree

4 files changed

+7
-10
lines changed

4 files changed

+7
-10
lines changed

profiler.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
import pstats
33
import random
44

5-
import torchvision # type: ignore[import-untyped] # pylint: disable=unused-import # noqa: F401
6-
from tqdm import trange # pylint: disable=unused-import # noqa: F401
5+
import torchvision # type: ignore[import-untyped] # noqa: F401
6+
from tqdm import trange # noqa: F401
77

8-
from torchinfo import summary # pylint: disable=unused-import # noqa: F401
8+
from torchinfo import summary # noqa: F401
99

1010

1111
def profile() -> None:

tests/fixtures/models.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# pylint: disable=too-few-public-methods
21
from __future__ import annotations
32

43
import math

tests/torchinfo_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -541,14 +541,14 @@ def test_empty_module_list() -> None:
541541

542542

543543
def test_single_parameter_model() -> None:
544-
class ParameterA(nn.Module): # pylint: disable=too-few-public-methods
544+
class ParameterA(nn.Module):
545545
"""A model with one parameter."""
546546

547547
def __init__(self) -> None:
548548
super().__init__()
549549
self.w = nn.Parameter(torch.zeros(1024))
550550

551-
class ParameterB(nn.Module): # pylint: disable=too-few-public-methods
551+
class ParameterB(nn.Module):
552552
"""A model with one parameter and one Conv2d layer."""
553553

554554
def __init__(self) -> None:

torchinfo/torchinfo.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,6 @@ class name as the key. If the forward pass is an expensive operation,
203203
model_mode = Mode(mode)
204204

205205
if verbose is None:
206-
# pylint: disable=no-member
207206
verbose = 0 if hasattr(sys, "ps1") and sys.ps1 else 1
208207

209208
if cache_forward_pass is None:
@@ -269,7 +268,7 @@ def forward_pass(
269268
**kwargs: Any,
270269
) -> list[LayerInfo]:
271270
"""Perform a forward pass on the model using forward hooks."""
272-
global _cached_forward_pass # pylint: disable=global-variable-not-assigned
271+
global _cached_forward_pass
273272
model_name = model.__class__.__name__
274273
if cache_forward_pass and model_name in _cached_forward_pass:
275274
return _cached_forward_pass[model_name]
@@ -664,7 +663,6 @@ def apply_hooks(
664663
# some unknown reason (infinite recursion)
665664
stack += [
666665
(name, mod, curr_depth + 1, global_layer_info[module_id])
667-
# pylint: disable=protected-access
668666
for name, mod in reversed(module._modules.items())
669667
if mod is not None
670668
]
@@ -673,5 +671,5 @@ def apply_hooks(
673671

674672
def clear_cached_forward_pass() -> None:
675673
"""Clear the forward pass cache."""
676-
global _cached_forward_pass # pylint: disable=global-statement
674+
global _cached_forward_pass
677675
_cached_forward_pass = {}

0 commit comments

Comments
 (0)