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

Function _count_ps

tensorflow/python/distribute/estimator_training.py:40–46  ·  view source on GitHub ↗

Counts the number of parameter servers in cluster_spec.

(cluster_spec)

Source from the content-addressed store, hash-verified

38
39
40def _count_ps(cluster_spec):
41 """Counts the number of parameter servers in cluster_spec."""
42 if not cluster_spec:
43 raise RuntimeError(
44 'Internal error: `_count_ps` does not expect empty cluster_spec.')
45
46 return len(cluster_spec.as_dict().get(PS, []))
47
48
49def _count_worker(cluster_spec, chief_task_type):

Callers 1

Calls 2

getMethod · 0.45
as_dictMethod · 0.45

Tested by

no test coverage detected