Converts current model into an TRT engine. Uses provided converter to convert object or default_convert is used instead if available. Args: output_fpath (str): File location of the generated ONNX file. converter (ModelFileConverter): Class to convert
(
self,
output_fpath: str,
converter: ModelFileConverter = None,
force_overwrite: bool = False,
profiles: List[Profile] = [],
preview_features: List[PreviewFeature] = []
)
| 223 | ) |
| 224 | |
| 225 | def as_trt_engine( |
| 226 | self, |
| 227 | output_fpath: str, |
| 228 | converter: ModelFileConverter = None, |
| 229 | force_overwrite: bool = False, |
| 230 | profiles: List[Profile] = [], |
| 231 | preview_features: List[PreviewFeature] = [] |
| 232 | ): |
| 233 | """ |
| 234 | Converts current model into an TRT engine. |
| 235 | Uses provided converter to convert object or default_convert is used instead if available. |
| 236 | |
| 237 | Args: |
| 238 | output_fpath (str): File location of the generated ONNX file. |
| 239 | converter (ModelFileConverter): Class to convert current model instance into another. |
| 240 | force_overwrite (bool): If the file already exists, tell whether or not to overwrite. |
| 241 | Since torch models folders, can potentially erase entire folders. |
| 242 | profiles (List[polygraphy.backend.trt.Profile]): The optimization profiles used to build the engine. |
| 243 | preview_features (List[tensorrt.PreviewFeature]): The preview features to enable when building the engine. |
| 244 | |
| 245 | Returns: |
| 246 | TRTEngineFile: Newly generated ONNXModelFile |
| 247 | """ |
| 248 | raise NotImplementedError( |
| 249 | "Current model does not support exporting to trt engine." |
| 250 | ) |
| 251 | |
| 252 | @abstractmethod |
| 253 | def cleanup(self) -> None: |
no outgoing calls
no test coverage detected