MCPcopy Index your code
hub / github.com/tensorlayer/TensorLayer / create_tf_jobs

Function create_tf_jobs

tensorlayer/cli/train.py:106–117  ·  view source on GitHub ↗
(cluster_spec, prog, args)

Source from the content-addressed store, hash-verified

104
105
106def create_tf_jobs(cluster_spec, prog, args):
107 gpu_assignment = dict((('worker', idx), gpu_idx) for (idx, gpu_idx) in enumerate(GPU_IDS))
108 for job_type in cluster_spec:
109 for task_index in range(len(cluster_spec[job_type])):
110 new_env = os.environ.copy()
111 new_env.update(
112 {
113 'CUDA_VISIBLE_DEVICES': str(gpu_assignment.get((job_type, task_index), '')),
114 'TF_CONFIG': json.dumps(create_tf_config(cluster_spec, job_type, task_index)),
115 }
116 )
117 yield subprocess.Popen(['python3', prog] + args, env=new_env)
118
119
120def validate_arguments(args):

Callers 1

mainFunction · 0.85

Calls 3

create_tf_configFunction · 0.85
getMethod · 0.80
updateMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…