(self, file)
| 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 |
no test coverage detected