MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / all_worker_devices

Function all_worker_devices

tensorflow/python/tpu/session_support.py:162–174  ·  view source on GitHub ↗

Return a list of devices for each worker in the system.

(session)

Source from the content-addressed store, hash-verified

160
161
162def all_worker_devices(session):
163 """Return a list of devices for each worker in the system."""
164 devices = session.list_devices()
165
166 devices_that_support_heartbeats = []
167
168 for device in devices:
169 name = device.name
170 # Pick devices that have a TPU but target the attached CPU
171 if ':TPU:0' in name and 'coordinator' not in name:
172 devices_that_support_heartbeats.append(name.replace('TPU', 'CPU'))
173
174 return devices_that_support_heartbeats
175
176
177class WatchdogManager(threading.Thread):

Callers 2

_reset_managerMethod · 0.85
after_create_sessionMethod · 0.85

Calls 3

replaceMethod · 0.80
list_devicesMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected