File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
src/lightning/pytorch/core Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -1542,8 +1542,6 @@ def forward(self, x):
1542
1542
f"`{ type (self ).__name__ } .to_tensorrt` requires `torch_tensorrt` to be installed. "
1543
1543
)
1544
1544
1545
- import torch_tensorrt
1546
-
1547
1545
mode = self .training
1548
1546
device = self .device
1549
1547
if self .device .type != "cuda" :
@@ -1564,6 +1562,9 @@ def forward(self, x):
1564
1562
" `model.example_input_array` attribute is set."
1565
1563
)
1566
1564
input_sample = self .example_input_array
1565
+
1566
+ import torch_tensorrt
1567
+
1567
1568
input_sample = copy .deepcopy ((input_sample ,) if isinstance (input_sample , torch .Tensor ) else input_sample )
1568
1569
input_sample = self ._on_before_batch_transfer (input_sample )
1569
1570
input_sample = self ._apply_batch_transfer_handler (input_sample )
You can’t perform that action at this time.
0 commit comments