The condition blob is the last external_output that must be a single bool
(condition_net)
| 81 | |
| 82 | |
| 83 | def 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 | |
| 97 | def BoolNet(*blobs_with_bool_value): |
no test coverage detected
searching dependent graphs…