MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT / load

Method load

quickstart/IntroNotebooks/onnx_helper.py:36–41  ·  view source on GitHub ↗
(self, file)

Source from the content-addressed store, hash-verified

34 self.stream = None
35
36 def load(self, file):
37 f = open(file, "rb")
38 runtime = trt.Runtime(trt.Logger(trt.Logger.WARNING))
39
40 engine = runtime.deserialize_cuda_engine(f.read())
41 self.context = engine.create_execution_context()
42
43 def allocate_memory(self, batch):
44 self.output = np.empty(self.num_classes, dtype = self.target_dtype) # Need to set both input and output precisions to FP16 to fully enable FP16

Callers 4

__init__Method · 0.95
__init__Method · 0.45
load_modelMethod · 0.45
load_modelMethod · 0.45

Calls 2

readMethod · 0.80
LoggerMethod · 0.45

Tested by

no test coverage detected