Skip to content

Commit caba43c

Browse files
committed
import
1 parent ee596a6 commit caba43c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/lightning/pytorch/core/module.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,13 @@
7575

7676
if TYPE_CHECKING:
7777
from torch.distributed.device_mesh import DeviceMesh
78-
from torch.onnx import ONNXProgram
7978

8079
_ONNX_AVAILABLE = RequirementCache("onnx")
8180
_ONNXSCRIPT_AVAILABLE = RequirementCache("onnxscript")
8281

82+
if TYPE_CHECKING and _ONNXSCRIPT_AVAILABLE:
83+
from torch.onnx import ONNXProgram
84+
8385
warning_cache = WarningCache()
8486
log = logging.getLogger(__name__)
8587

0 commit comments

Comments
 (0)