Pass through attributes defined in the model if they are not overridden by ds-engine.
(self, name)
| 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] |
no test coverage detected