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 e6f8097 commit a9047feCopy full SHA for a9047fe
src/lightning/pytorch/core/module.py
@@ -1548,8 +1548,9 @@ def forward(self, x):
1548
device = self.device
1549
if self.device.type != "cuda":
1550
default_device = torch.device(default_device) if isinstance(default_device, str) else default_device
1551
- if default_device.type != "cuda":
1552
- raise ValueError(
+
+ if not torch.cuda.is_available() or default_device.type != "cuda":
1553
+ raise MisconfigurationException(
1554
f"TensorRT only supports CUDA devices. The current device is {self.device}."
1555
f" Please set the `default_device` argument to a CUDA device."
1556
)
0 commit comments