File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 3
3
4
4
def test_precision_plugin_renamed_imports ():
5
5
# base class
6
+ from lightning .pytorch .plugins .precision .precision_plugin import PrecisionPlugin as PrecisionPlugin0
7
+
6
8
from lightning .pytorch .plugins import PrecisionPlugin as PrecisionPlugin2
7
9
from lightning .pytorch .plugins .precision import PrecisionPlugin as PrecisionPlugin1
8
10
from lightning .pytorch .plugins .precision .precision import Precision
9
- from lightning .pytorch .plugins .precision .precision_plugin import PrecisionPlugin as PrecisionPlugin0
10
11
11
12
assert issubclass (PrecisionPlugin0 , Precision )
12
13
assert issubclass (PrecisionPlugin1 , Precision )
Original file line number Diff line number Diff line change @@ -42,11 +42,12 @@ def test_is_overridden():
42
42
reason = "This test is ONLY relevant for the UNIFIED package" ,
43
43
)
44
44
def test_mixed_imports_unified ():
45
- from lightning .pytorch .utilities .compile import _maybe_unwrap_optimized as new_unwrap
46
- from lightning .pytorch .utilities .model_helpers import is_overridden as new_is_overridden
47
45
from pytorch_lightning .callbacks import EarlyStopping as OldEarlyStopping
48
46
from pytorch_lightning .demos .boring_classes import BoringModel as OldBoringModel
49
47
48
+ from lightning .pytorch .utilities .compile import _maybe_unwrap_optimized as new_unwrap
49
+ from lightning .pytorch .utilities .model_helpers import is_overridden as new_is_overridden
50
+
50
51
model = OldBoringModel ()
51
52
with pytest .raises (TypeError , match = r"`pytorch_lightning` object \(BoringModel\) to a `lightning.pytorch`" ):
52
53
new_unwrap (model )
You can’t perform that action at this time.
0 commit comments