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

Method wait

tensorflow/python/distribute/distribute_coordinator.py:81–92  ·  view source on GitHub ↗

Waits until all other callers reach the same wait call.

(self)

Source from the content-addressed store, hash-verified

79 self._condition = threading.Condition()
80
81 def wait(self):
82 """Waits until all other callers reach the same wait call."""
83 self._local_sense.value = not self._flag
84 with self._lock:
85 self._counter += 1
86 if self._counter == self._num_participants:
87 self._counter = 0
88 self._flag = self._local_sense.value
89 with self._condition:
90 while self._flag != self._local_sense.value:
91 self._condition.wait()
92 self._condition.notify_all()
93
94
95def _get_num_workers(cluster_spec):

Calls 1

notify_allMethod · 0.80

Tested by 15

generatorMethod · 0.36
map_py_fnFunction · 0.36
do_test_evMethod · 0.36
map_py_fnMethod · 0.36
tearDownClassMethod · 0.36
tearDownClassMethod · 0.36
tearDownClassMethod · 0.36