We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ee596a6 commit caba43cCopy full SHA for caba43c
src/lightning/pytorch/core/module.py
@@ -75,11 +75,13 @@
75
76
if TYPE_CHECKING:
77
from torch.distributed.device_mesh import DeviceMesh
78
- from torch.onnx import ONNXProgram
79
80
_ONNX_AVAILABLE = RequirementCache("onnx")
81
_ONNXSCRIPT_AVAILABLE = RequirementCache("onnxscript")
82
+if TYPE_CHECKING and _ONNXSCRIPT_AVAILABLE:
83
+ from torch.onnx import ONNXProgram
84
+
85
warning_cache = WarningCache()
86
log = logging.getLogger(__name__)
87
0 commit comments