Skip to content

Commit 0046f66

Browse files
committed
fixed a bug in dynamic shape
1 parent 5fb0beb commit 0046f66

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

py/torch_tensorrt/dynamo/runtime/_PythonTorchTensorRTModule.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,11 @@ def run_standard_execution() -> torch.Tensor | Tuple[torch.Tensor, ...]:
503503
if can_use_pre_allocated_outputs:
504504
outputs = self.pre_allocated_outputs
505505
else:
506-
506+
if shape_changed:
507+
self.output_shapes = [
508+
tuple(self.context.get_tensor_shape(output_name))
509+
for output_name in self.output_names
510+
]
507511
if DYNAMIC_DIM in self.output_shapes:
508512
raise ValueError(
509513
"Encountered dynamic output shapes during runtime. This could mean the network has data-dependent output shapes which is not currently supported."

0 commit comments

Comments
 (0)