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

Method __init__

tensorflow/python/ops/work_queue.py:456–480  ·  view source on GitHub ↗

Constructs a LocalWorkMgr. Args: job_name: name of current tf-worker. task_index: index of current tf-worker. restore_works_dir: a directory that restore works for WorkQueue when failover. name: (Optional.) Name of the LocalWorkMgr. Raises: ValueError:

(self, job_name, task_index, restore_works_dir, name=None)

Source from the content-addressed store, hash-verified

454class LocalWorkMgr(object):
455 """A local work manager for inference job."""
456 def __init__(self, job_name, task_index, restore_works_dir, name=None):
457 """Constructs a LocalWorkMgr.
458
459 Args:
460 job_name: name of current tf-worker.
461 task_index: index of current tf-worker.
462 restore_works_dir: a directory that restore works for
463 WorkQueue when failover.
464 name: (Optional.) Name of the LocalWorkMgr.
465
466 Raises:
467 ValueError: If one of the arguments is invalid.
468 """
469
470 self._job_name = job_name
471 self._task_index = task_index
472 self._restore_works_dir = restore_works_dir
473 self._name = name or 'local_workqueue_mgr'
474 assert job_name in ['worker', 'chief'], \
475 'support chief or worker role, not {}'.format(job_name)
476 assert task_index >= 0, 'task_index must be >= 0, not {}'.format(task_index)
477 assert gfile.IsDirectory(restore_works_dir), \
478 '{} is not a directory.'.format(restore_works_dir)
479 self._get_local_works()
480 self._local_device = control_flow_ops.no_op().device
481
482 @property
483 def job_name(self):

Callers

nothing calls this directly

Calls 3

_get_local_worksMethod · 0.95
formatMethod · 0.45
IsDirectoryMethod · 0.45

Tested by

no test coverage detected