MCPcopy Create free account
hub / github.com/Project-MONAI/MONAI / _load_engine

Method _load_engine

monai/networks/trt_compiler.py:409–426  ·  view source on GitHub ↗

Loads TRT plan from disk and activates its execution context.

(self)

Source from the content-addressed store, hash-verified

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 """

Callers 1

forwardMethod · 0.95

Calls 2

TRTEngineClass · 0.85
infoMethod · 0.80

Tested by

no test coverage detected