Returns: trt.ICudaEngine: The engine that was saved.
(self)
| 724 | |
| 725 | @util.check_called_by("__call__") |
| 726 | def call_impl(self): |
| 727 | """ |
| 728 | Returns: |
| 729 | trt.ICudaEngine: The engine that was saved. |
| 730 | """ |
| 731 | engine, owns_engine = util.invoke_if_callable(self._engine) |
| 732 | |
| 733 | with contextlib.ExitStack() as stack: |
| 734 | if owns_engine: |
| 735 | stack.enter_context(util.FreeOnException([engine])) |
| 736 | |
| 737 | util.save_file(contents=bytes_from_engine(engine), dest=self.path, description="engine") |
| 738 | return engine |
| 739 | |
| 740 | |
| 741 | @mod.export(funcify=True) |