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)
| 272 | |
| 273 | |
| 274 | def 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 | |
| 295 | def _RunOnceIf(name, condition_blob_or_net, nets_or_steps): |
nothing calls this directly
no test coverage detected
searching dependent graphs…