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

Method task_indices

tensorflow/python/training/server_lib.py:394–411  ·  view source on GitHub ↗

Returns a list of valid task indices in the given job. Args: job_name: The string name of a job in this cluster. Returns: A list of valid task indices in the given job. Raises: ValueError: If `job_name` does not name a job in this cluster, or no task with index

(self, job_name)

Source from the content-addressed store, hash-verified

392 return len(job)
393
394 def task_indices(self, job_name):
395 """Returns a list of valid task indices in the given job.
396
397 Args:
398 job_name: The string name of a job in this cluster.
399
400 Returns:
401 A list of valid task indices in the given job.
402
403 Raises:
404 ValueError: If `job_name` does not name a job in this cluster,
405 or no task with index `task_index` is defined in that job.
406 """
407 try:
408 job = self._cluster_spec[job_name]
409 except KeyError:
410 raise ValueError("No such job in cluster: %r" % job_name)
411 return list(sorted(job.keys()))
412
413 def task_address(self, job_name, task_index):
414 """Returns the address of the given task in the given job.

Callers 4

_make_server_defFunction · 0.95
as_dictMethod · 0.95
get_workers_listFunction · 0.80

Calls 1

keysMethod · 0.45

Tested by 1