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

Method __del__

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

Source from the content-addressed store, hash-verified

1254 return replacement_sources
1255
1256 def __del__(self):
1257 # An explicitly destroyed engine can be garbage-collected after a new engine has wrapped the same model;
1258 # tearing it down again here would clear state that now belongs to the new engine.
1259 if getattr(self, "_destroyed", False):
1260 return
1261 try:
1262 self.destroy()
1263 except Exception as exc:
1264 # Avoid destructor-time exceptions for partially initialized engines.
1265 logger.debug("DeepSpeedEngine.__del__ cleanup skipped: %s", exc, exc_info=True)
1266
1267 def destroy(self):
1268 self._destroyed = True

Callers

nothing calls this directly

Calls 1

destroyMethod · 0.95

Tested by

no test coverage detected