Overrides batch dimension if dynamic.
(shape: tuple)
| 105 | """ |
| 106 | |
| 107 | def override_shape(shape: tuple) -> tuple: |
| 108 | """Overrides batch dimension if dynamic.""" |
| 109 | if TRT_DYNAMIC_DIM in shape: |
| 110 | shape = tuple( |
| 111 | [batch_size if dim == TRT_DYNAMIC_DIM else dim for dim in shape] |
| 112 | ) |
| 113 | return shape |
| 114 | |
| 115 | # Open engine as runtime |
| 116 | with open(engine_path, "rb") as f, trt.Runtime( |