r'''Construct a server specification.
(self)
| 294 | for t in worker_indices for g in range(self._num_gpus)] |
| 295 | |
| 296 | def __init__(self): |
| 297 | r'''Construct a server specification. |
| 298 | ''' |
| 299 | self._task_type = 'localhost' |
| 300 | self._rank = hvd.local_rank() |
| 301 | self._world_size = hvd.size() |
| 302 | self._task_id = 0 |
| 303 | self._cluster_spec = None |
| 304 | self._is_chief = True |
| 305 | visible_devices = os.getenv('CUDA_VISIBLE_DEVICES', '') |
| 306 | if visible_devices: |
| 307 | self._num_gpus = len(visible_devices.split(',')) |
| 308 | else: |
| 309 | self._num_gpus = 1 |
| 310 | self._update() |
| 311 | self._saving_listener_registry = {} |
| 312 | |
| 313 | |
| 314 | class GraphRewriting(object): # pylint: disable=useless-object-inheritance |