File tree Expand file tree Collapse file tree 3 files changed +11
-6
lines changed
tests/fixtures/vision/checker Expand file tree Collapse file tree 3 files changed +11
-6
lines changed Original file line number Diff line number Diff line change 24
24
import torchvision .transforms .v2
25
25
26
26
torchvision .transforms .v2 .ToTensor
27
+
28
+ from torchvision .transforms .v2 import *
Original file line number Diff line number Diff line change 13
13
from .visitors .performance import TorchSynchronizedDataLoaderVisitor
14
14
from .visitors .misc import TorchRequireGradVisitor
15
15
from .visitors .vision import (
16
- TorchVisionDeprecatedPretrainedVisitor , TorchVisionDeprecatedToTensorVisitor
16
+ TorchVisionDeprecatedPretrainedVisitor ,
17
+ TorchVisionDeprecatedToTensorVisitor ,
17
18
)
18
19
19
- __version__ = "0.1.0 "
20
+ __version__ = "0.1.1 "
20
21
21
22
DEPRECATED_CONFIG_PATH = Path (__file__ ).absolute ().parent / "deprecated_symbols.yaml"
22
23
Original file line number Diff line number Diff line change
1
+ from collections .abc import Sequence
1
2
import libcst as cst
2
3
3
4
from ...common import LintViolation , TorchVisitor
@@ -34,10 +35,11 @@ def visit_ImportFrom(self, node):
34
35
if module_path is None :
35
36
return
36
37
37
- for import_node in node .names :
38
- self ._maybe_add_violation (
39
- f"{ module_path } .{ import_node .evaluated_name } " , import_node
40
- )
38
+ if isinstance (node .names , Sequence ):
39
+ for import_node in node .names :
40
+ self ._maybe_add_violation (
41
+ f"{ module_path } .{ import_node .evaluated_name } " , import_node
42
+ )
41
43
42
44
def visit_Attribute (self , node ):
43
45
qualified_names = self .get_metadata (cst .metadata .QualifiedNameProvider , node )
You can’t perform that action at this time.
0 commit comments