MCPcopy
hub / github.com/tensorlayer/TensorLayer / device_fn

Method device_fn

tensorlayer/distributed.py:326–332  ·  view source on GitHub ↗

Returns the function with the specification to create the graph in this server

(self)

Source from the content-addressed store, hash-verified

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():

Callers 2

run_workerFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected