"tests/nn/vscode:/vscode.git/clone" did not exist on "67bf5bf8df7ccc8bd0300e11fb9aef31479af13e"
Unverified Commit 98672351 authored by Yuefeng Zhou's avatar Yuefeng Zhou Committed by GitHub
Browse files

Update distribution_utils.py (#6615)

parent 4ad73a1c
......@@ -230,9 +230,8 @@ def configure_cluster(worker_hosts=None, task_index=-1):
"""
tf_config = json.loads(os.environ.get('TF_CONFIG', '{}'))
if tf_config:
num_workers = len(tf_config['cluster']['worker'])
if tf_config['cluster'].get('chief', None):
num_workers += 1
num_workers = (len(tf_config['cluster'].get('chief', [])) +
len(tf_config['cluster'].get('worker', [])))
elif worker_hosts:
workers = worker_hosts.split(',')
num_workers = len(workers)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment