Returns the function with the specification to create the graph in this server
(self)
| 324 | return self.type == 'worker' and self.num_workers == self._index |
| 325 | |
| 326 | def device_fn(self): |
| 327 | """Returns the function with the specification to create the graph in this server""" |
| 328 | current_device = '/job:{}/task:{}'.format(self.type, self._index) |
| 329 | ps_devices = '/job:ps' |
| 330 | return tf.train.replica_device_setter( |
| 331 | ps_device=ps_devices, worker_device=current_device, cluster=self._cluster_spec |
| 332 | ) |
| 333 | |
| 334 | def create_server(self): |
| 335 | if self._server is None and self.ps_hosts and self.worker_hosts and not self.is_evaluator(): |
no outgoing calls
no test coverage detected