Skip to content

Commit 35a8b49

Browse files
authored
Add a test against regressions.
1 parent 8c6698e commit 35a8b49

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/tests_pytorch/models/test_torchscript.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@
2626
from tests_pytorch.helpers.runif import RunIf
2727

2828

29+
def test_torchscript_vanilla():
30+
"""Test that LightningModule itself can be converted."""
31+
model = LightningModule()
32+
33+
script = model.to_torchscript()
34+
assert isinstance(script, torch.jit.ScriptModule)
35+
36+
2937
@pytest.mark.parametrize("modelclass", [BoringModel, ParityModuleRNN, BasicGAN])
3038
def test_torchscript_input_output(modelclass):
3139
"""Test that scripted LightningModule forward works."""

0 commit comments

Comments
 (0)