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

Function GetConditionBlobFromNet

caffe2/python/control.py:83–94  ·  view source on GitHub ↗

The condition blob is the last external_output that must be a single bool

(condition_net)

Source from the content-addressed store, hash-verified

81
82
83def GetConditionBlobFromNet(condition_net):
84 """
85 The condition blob is the last external_output that must
86 be a single bool
87 """
88 assert len(condition_net.Proto().external_output) > 0, (
89 "Condition net %s must has at least one external output" %
90 condition_net.Proto.name)
91 # we need to use a blob reference here instead of a string
92 # otherwise, it will add another name_scope to the input later
93 # when we create new ops (such as OR of two inputs)
94 return core.BlobReference(condition_net.Proto().external_output[-1])
95
96
97def BoolNet(*blobs_with_bool_value):

Callers 8

NotNetFunction · 0.85
MergeConditionNetsFunction · 0.85
CombineConditionsFunction · 0.85
_RunOnceIfNotFunction · 0.85
UntilFunction · 0.85
DoUntilFunction · 0.85
IfFunction · 0.85
IfNotFunction · 0.85

Calls 1

ProtoMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…