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

Method __getattr__

deepspeed/runtime/engine.py:1455–1473  ·  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

1453 return self._global_grad_norm
1454
1455 def __getattr__(self, name):
1456 """
1457 Pass through attributes defined in the model if they are not overridden by ds-engine.
1458 """
1459 try:
1460 return super().__getattr__(name)
1461 except AttributeError:
1462 _module = self.__dict__.get("module")
1463 if _module is None:
1464 try:
1465 _module = super().__getattr__("module")
1466 except AttributeError:
1467 _module = None
1468 if _module is not None:
1469 try:
1470 return getattr(_module, name)
1471 except AttributeError:
1472 pass
1473 raise AttributeError(f"'{type(self).__name__}' object has no attribute '{name}'")
1474
1475 def checkpoint_serialization_enabled(self):
1476 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