MCPcopy Index your code
hub / github.com/pytorch/pytorch / DoParallel

Function DoParallel

caffe2/python/control.py:274–292  ·  view source on GitHub ↗

Execute the nets or steps in parallel, waiting for all of them to finish Examples: - DoParallel('pDo', net1, net2, ..., net_n) - DoParallel('pDo', list_of_nets) - DoParallel('pDo', step1, step2, ..., step_n) - DoParallel('pDo', list_of_steps)

(name, *nets_or_steps)

Source from the content-addressed store, hash-verified

272
273
274def DoParallel(name, *nets_or_steps):
275 """
276 Execute the nets or steps in parallel, waiting for all of them to finish
277
278 Examples:
279 - DoParallel('pDo', net1, net2, ..., net_n)
280 - DoParallel('pDo', list_of_nets)
281 - DoParallel('pDo', step1, step2, ..., step_n)
282 - DoParallel('pDo', list_of_steps)
283 """
284 nets_or_steps = _MakeList(nets_or_steps)
285 if (len(nets_or_steps) == 1 and isinstance(
286 nets_or_steps[0], core.ExecutionStep)):
287 return nets_or_steps[0]
288 else:
289 return core.scoped_execution_step(
290 _get_next_step_name('DoParallel', name),
291 nets_or_steps,
292 concurrent_substeps=True)
293
294
295def _RunOnceIf(name, condition_blob_or_net, nets_or_steps):

Callers

nothing calls this directly

Calls 3

_MakeListFunction · 0.85
isinstanceFunction · 0.85
_get_next_step_nameFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…