(engine_file_path)
| 11 | SKIP_ENGINE_MODEL_CHECK = True |
| 12 | |
| 13 | def get_engine(engine_file_path): |
| 14 | if os.path.exists(engine_file_path): |
| 15 | print(f"Loading engine from file {engine_file_path}...") |
| 16 | with open(engine_file_path, "rb") as f, trt.Runtime(TRT_LOGGER) as runtime: |
| 17 | return runtime.deserialize_cuda_engine(f.read()) |
| 18 | else: |
| 19 | print(f"No file named {engine_file_path}! Please check the input.") |
| 20 | return None |
| 21 | |
| 22 | |
| 23 | def numpy_to_torch_dtype(np_dtype): |