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

Function _test_if

caffe2/python/net_builder_test.py:71–79  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

69
70
71def _test_if(x):
72 y = ops.Const(1)
73 with ops.If(ops.GT([x, ops.Const(50)])):
74 ops.Const(2, blob_out=y)
75 with ops.If(ops.LT([x, ops.Const(50)])):
76 ops.Const(3, blob_out=y)
77 ops.stop()
78 ops.Const(4, blob_out=y)
79 return y
80
81
82class TestNetBuilder(unittest.TestCase):

Callers 1

test_opsMethod · 0.85

Calls 3

ConstMethod · 0.80
IfMethod · 0.80
stopMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…