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

Method IfNotCondTest

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

Source from the content-addressed store, hash-verified

207 self.IfElseCondTest(self.false_cond_net_, False, 2, True)
208
209 def IfNotCondTest(self, cond_net, expect, cond_on_blob):
210 if cond_on_blob:
211 step = control.Do(
212 'if-not',
213 control.Do('count', cond_net),
214 control.IfNot('myIfNot', cond_net.Proto().external_output[-1],
215 self.cnt_net_))
216 else:
217 step = control.IfNot('myIfNot', cond_net, self.cnt_net_)
218 self.BuildAndRunPlan(step)
219 self.CheckNetOutput([(self.cnt_net_, expect)])
220
221 def testIfNotCondTrueOnNet(self):
222 self.IfNotCondTest(self.true_cond_net_, 0, False)

Callers 4

Calls 3

BuildAndRunPlanMethod · 0.95
CheckNetOutputMethod · 0.95
ProtoMethod · 0.45

Tested by

no test coverage detected