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

Function NotNet

caffe2/python/control.py:129–150  ·  view source on GitHub ↗

Not of a condition blob or net Args: condition_blob_or_net can be either blob or net. If condition_blob_or_net is Net, the condition is its last external_output that must be a single bool. returns not_net: the net NOT the input out_blob: the output blob of the not_net

(condition_blob_or_net)

Source from the content-addressed store, hash-verified

127
128
129def NotNet(condition_blob_or_net):
130 """Not of a condition blob or net
131
132 Args:
133 condition_blob_or_net can be either blob or net. If condition_blob_or_net
134 is Net, the condition is its last external_output
135 that must be a single bool.
136
137 returns
138 not_net: the net NOT the input
139 out_blob: the output blob of the not_net
140 """
141 if isinstance(condition_blob_or_net, core.Net):
142 condition_blob = GetConditionBlobFromNet(condition_blob_or_net)
143 else:
144 condition_blob = condition_blob_or_net
145
146 not_net = core.Net('not_net')
147 out_blob = not_net.Not(condition_blob)
148 not_net.AddExternalOutput(out_blob)
149
150 return not_net, out_blob
151
152
153def _CopyConditionBlobNet(condition_blob):

Callers 3

_RunOnceIfFunction · 0.85
WhileFunction · 0.85
DoWhileFunction · 0.85

Calls 4

AddExternalOutputMethod · 0.95
isinstanceFunction · 0.85
GetConditionBlobFromNetFunction · 0.85
NetMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…