| 1344 | ) & int(core.op_proto_and_checker_maker.OpRole.Optimize) |
| 1345 | |
| 1346 | def __del__(self) -> None: |
| 1347 | # NOTE(Ruibiao): The manually call of clear is required. Because in Python, executor_cache |
| 1348 | # may not immediately destructed after Executor instance deleted (so does not the _StandaloneExecutor), |
| 1349 | # that brings errors to one-dnn unit tests (see ClearONEDNNCache in interpretercore.cc for why). |
| 1350 | self.close() |
| 1351 | self._executor_cache.clear() |
| 1352 | |
| 1353 | def _set_plan(self, plan): |
| 1354 | self.plan = plan |