Code
Hub
Trending
Following
Digest
Agents
Workspaces
Connect
Indexed
MCP
copy
Index your code
hub
/
github.com/pytorch/pytorch
/ _test_loop
Function
_test_loop
caffe2/python/net_builder_test.py:34–41 ·
view source on GitHub ↗
()
Source
from the content-addressed store, hash-verified
32
33
34
def
_test_loop():
35
x = ops.Const(5)
36
y = ops.Const(0)
37
with
ops.loop():
38
ops.stop_if(ops.EQ([x, ops.Const(0)]))
39
ops.Add([x, ops.Const(-1)], [x])
40
ops.Add([y, ops.Const(1)], [y])
41
return
y
42
43
44
def
_test_inner_stop(x):
Callers
1
test_ops
Method · 0.85
Calls
4
Const
Method · 0.80
loop
Method · 0.45
stop_if
Method · 0.45
Add
Method · 0.45
Tested by
no test coverage detected
Used in the wild
real call sites across dependent graphs
searching dependent graphs…