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

Method __getattr__

deepspeed/runtime/engine.py:1402–1420  ·  view source on GitHub ↗

Pass through attributes defined in the model if they are not overridden by ds-engine.

(self, name)

Source from the content-addressed store, hash-verified

1400 return self._global_grad_norm
1401
1402 def __getattr__(self, name):
1403 """
1404 Pass through attributes defined in the model if they are not overridden by ds-engine.
1405 """
1406 try:
1407 return super().__getattr__(name)
1408 except AttributeError:
1409 _module = self.__dict__.get("module")
1410 if _module is None:
1411 try:
1412 _module = super().__getattr__("module")
1413 except AttributeError:
1414 _module = None
1415 if _module is not None:
1416 try:
1417 return getattr(_module, name)
1418 except AttributeError:
1419 pass
1420 raise AttributeError(f"'{type(self).__name__}' object has no attribute '{name}'")
1421
1422 def checkpoint_serialization_enabled(self):
1423 return self._config.checkpoint_config[CHECKPOINT_SERIALIZATION]

Callers 2

_rnn_forward_hookFunction · 0.45
_rnn_cell_forward_hookFunction · 0.45

Calls 1

getMethod · 0.45

Tested by

no test coverage detected