Counts the number of parameter servers in cluster_spec.
(cluster_spec)
| 38 | |
| 39 | |
| 40 | def _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 | |
| 49 | def _count_worker(cluster_spec, chief_task_type): |
no test coverage detected