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

Function _test_outer

caffe2/python/net_builder_test.py:48–68  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

46
47
48def _test_outer():
49 x = ops.Const(10)
50 # test stop_if(False)
51 with ops.stop_guard() as g1:
52 _test_inner_stop(x)
53
54 # test stop_if(True)
55 y = ops.Const(3)
56 with ops.stop_guard() as g2:
57 _test_inner_stop(y)
58
59 # test no stop
60 with ops.stop_guard() as g4:
61 ops.Const(0)
62
63 # test empty clause
64 with ops.stop_guard() as g3:
65 pass
66
67 return (
68 g1.has_stopped(), g2.has_stopped(), g3.has_stopped(), g4.has_stopped())
69
70
71def _test_if(x):

Callers 1

test_opsMethod · 0.85

Calls 4

_test_inner_stopFunction · 0.85
ConstMethod · 0.80
stop_guardMethod · 0.80
has_stoppedMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…