Loads TRT plan from disk and activates its execution context.
(self)
| 407 | return trt_inputs |
| 408 | |
| 409 | def _load_engine(self): |
| 410 | """ |
| 411 | Loads TRT plan from disk and activates its execution context. |
| 412 | """ |
| 413 | try: |
| 414 | self.engine = TRTEngine(self.plan_path, self.logger) |
| 415 | # Make sure we have names correct |
| 416 | input_table = {} |
| 417 | for name in self.engine.input_names: |
| 418 | if name.startswith("__") and name not in self.input_names: |
| 419 | orig_name = name[2:] |
| 420 | else: |
| 421 | orig_name = name |
| 422 | input_table[name] = orig_name |
| 423 | self.engine.input_table = input_table |
| 424 | self.logger.info(f"Engine loaded, inputs:{self.engine.input_table}") |
| 425 | except Exception as e: |
| 426 | self.logger.info(f"Exception while loading the engine:\n{e}") |
| 427 | |
| 428 | def forward(self, model, argv, kwargs): |
| 429 | """ |