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

Method local_workqueue_empty

tensorflow/python/ops/work_queue.py:578–598  ·  view source on GitHub ↗

Return the truth value if local workqueue empty.

(self)

Source from the content-addressed store, hash-verified

576 return RestoreWorksBarrierHook()
577
578 def local_workqueue_empty(self):
579 """Return the truth value if local workqueue empty."""
580 with ops.name_scope(self._name):
581 with ops.device(self._local_device):
582 with ops.device('/cpu:0'):
583 def _body(_):
584 with ops.control_dependencies([
585 logging_ops.print_v2(
586 "Wait to set restore_works_barrier to false,",
587 " maybe LocalWorkMgr hook not set."
588 " restore_works_barrier:", self.restore_works_barrier)]):
589 return constant_op.constant(False)
590 # wait for the local works restored to complete
591 wait = control_flow_ops.while_loop(
592 lambda _: self.restore_works_barrier,
593 _body,
594 [self.restore_works_barrier],
595 parallel_iterations=1)
596 with ops.control_dependencies([wait]):
597 queue_size = self._restore_work_queue.size()
598 return math_ops.equal(queue_size, 0)

Callers 1

takeMethod · 0.80

Calls 6

equalMethod · 0.80
name_scopeMethod · 0.45
deviceMethod · 0.45
while_loopMethod · 0.45
control_dependenciesMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected