Similar to _RunOnceIf() but Execute nets_or_steps once if condition_blob_or_net evaluates as false.
(name, condition_blob_or_net, nets_or_steps)
| 324 | |
| 325 | |
| 326 | def _RunOnceIfNot(name, condition_blob_or_net, nets_or_steps): |
| 327 | """ |
| 328 | Similar to _RunOnceIf() but Execute nets_or_steps once if |
| 329 | condition_blob_or_net evaluates as false. |
| 330 | """ |
| 331 | if isinstance(condition_blob_or_net, core.Net): |
| 332 | condition_blob = GetConditionBlobFromNet(condition_blob_or_net) |
| 333 | nets_or_steps = _PrependNets(nets_or_steps, condition_blob_or_net) |
| 334 | else: |
| 335 | copy_net, condition_blob = _CopyConditionBlobNet(condition_blob_or_net) |
| 336 | nets_or_steps = _PrependNets(nets_or_steps, copy_net) |
| 337 | |
| 338 | return core.scoped_execution_step( |
| 339 | _get_next_step_name('_RunOnceIfNot', name), |
| 340 | nets_or_steps, |
| 341 | should_stop_blob=condition_blob, |
| 342 | only_once=True, |
| 343 | ) |
| 344 | |
| 345 | |
| 346 | def For(name, nets_or_steps, iter_num): |
no test coverage detected
searching dependent graphs…