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

Method __getattr__

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

871 return self._global_grad_norm
872
873 def __getattr__(self, name):
874 """
875 Pass through attributes defined in the model if they are not overridden by ds-engine.
876 """
877
878 _module = {}
879 if "module" in self.__dict__:
880 _module = self.__dict__['module']
881 if name in dir(self):
882 return getattr(self, name)
883 elif name in dir(_module):
884 return getattr(_module, name)
885 else:
886 raise AttributeError(f"'{type(self).__name__}' object has no attribute '{name}'")
887
888 def checkpoint_serialization_enabled(self):
889 return self._config.checkpoint_config[CHECKPOINT_SERIALIZATION]

Callers 2

_rnn_forward_hookFunction · 0.45
_rnn_cell_forward_hookFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected