Initializes the Async Trainer base class.
(self)
| 37 | """Trainer class for both sync and async Strategy.""" |
| 38 | |
| 39 | def init_async(self): |
| 40 | """Initializes the Async Trainer base class.""" |
| 41 | assert isinstance(self._strategy, tf.distribute.Strategy) |
| 42 | self._is_async = isinstance( |
| 43 | self._strategy, tf.distribute.experimental.ParameterServerStrategy) |
| 44 | self._coordinator = None |
| 45 | if self._is_async: |
| 46 | self._coordinator = ( |
| 47 | tf.distribute.experimental.coordinator.ClusterCoordinator( |
| 48 | self._strategy)) |
| 49 | |
| 50 | def coordinator_for_async( |
| 51 | self, |
no outgoing calls