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

Method testSwitch

caffe2/python/control_test.py:263–270  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

261 self.IfNotElseCondTest(self.false_cond_net_, False, 1, True)
262
263 def testSwitch(self):
264 step = control.Switch(
265 'mySwitch',
266 (self.false_cond_net_, self.cnt_net_),
267 (self.true_cond_net_, self.cnt_2_net_)
268 )
269 self.BuildAndRunPlan(step)
270 self.CheckNetOutput([(self.cnt_net_, 0), (self.cnt_2_net_, 2)])
271
272 def testSwitchNot(self):
273 step = control.SwitchNot(

Callers

nothing calls this directly

Calls 2

BuildAndRunPlanMethod · 0.95
CheckNetOutputMethod · 0.95

Tested by

no test coverage detected