MCPcopy Create free account
hub / github.com/deepspeedai/DeepSpeed / __del__

Method __del__

deepspeed/runtime/engine.py:1309–1318  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1307 return replacement_sources
1308
1309 def __del__(self):
1310 # An explicitly destroyed engine can be garbage-collected after a new engine has wrapped the same model;
1311 # tearing it down again here would clear state that now belongs to the new engine.
1312 if getattr(self, "_destroyed", False):
1313 return
1314 try:
1315 self.destroy()
1316 except Exception as exc:
1317 # Avoid destructor-time exceptions for partially initialized engines.
1318 logger.debug("DeepSpeedEngine.__del__ cleanup skipped: %s", exc, exc_info=True)
1319
1320 def destroy(self):
1321 self._destroyed = True

Callers

nothing calls this directly

Calls 1

destroyMethod · 0.95

Tested by

no test coverage detected