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

Method IfCondTest

caffe2/python/control_test.py:156–166  ·  view source on GitHub ↗
(self, cond_net, expect, cond_on_blob)

Source from the content-addressed store, hash-verified

154 self.DoUntilLoopTest([self.idle_net_, step])
155
156 def IfCondTest(self, cond_net, expect, cond_on_blob):
157 if cond_on_blob:
158 step = control.Do(
159 'if-all',
160 control.Do('count', cond_net),
161 control.If('myIf', cond_net.Proto().external_output[-1],
162 self.cnt_net_))
163 else:
164 step = control.If('myIf', cond_net, self.cnt_net_)
165 self.BuildAndRunPlan(step)
166 self.CheckNetOutput([(self.cnt_net_, expect)])
167
168 def testIfCondTrueOnNet(self):
169 self.IfCondTest(self.true_cond_net_, 1, False)

Callers 4

testIfCondTrueOnNetMethod · 0.95
testIfCondTrueOnBlobMethod · 0.95
testIfCondFalseOnNetMethod · 0.95
testIfCondFalseOnBlobMethod · 0.95

Calls 4

BuildAndRunPlanMethod · 0.95
CheckNetOutputMethod · 0.95
IfMethod · 0.80
ProtoMethod · 0.45

Tested by

no test coverage detected