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)
| 127 | |
| 128 | |
| 129 | def 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 | |
| 153 | def _CopyConditionBlobNet(condition_blob): |
no test coverage detected
searching dependent graphs…