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

Function Until

caffe2/python/control.py:412–426  ·  view source on GitHub ↗

Similar to While() but execute nets_or_steps when condition_blob_or_net returns false

(name, condition_blob_or_net, nets_or_steps)

Source from the content-addressed store, hash-verified

410
411
412def Until(name, condition_blob_or_net, nets_or_steps):
413 """
414 Similar to While() but execute nets_or_steps when
415 condition_blob_or_net returns false
416 """
417 if isinstance(condition_blob_or_net, core.Net):
418 stop_blob = GetConditionBlobFromNet(condition_blob_or_net)
419 nets_or_steps = _PrependNets(nets_or_steps, condition_blob_or_net)
420 else:
421 stop_blob = core.BlobReference(str(condition_blob_or_net))
422
423 return core.scoped_execution_step(
424 _get_next_step_name('Until', name),
425 nets_or_steps,
426 should_stop_blob=stop_blob)
427
428
429def DoWhile(name, condition_blob_or_net, nets_or_steps):

Callers

nothing calls this directly

Calls 4

isinstanceFunction · 0.85
GetConditionBlobFromNetFunction · 0.85
_PrependNetsFunction · 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…