Beispiel #1
0
def _test_loop():
    x = ops.Const(5)
    y = ops.Const(0)
    with ops.loop():
        ops.stop_if(ops.EQ([x, ops.Const(0)]))
        ops.Add([x, ops.Const(-1)], [x])
        ops.Add([y, ops.Const(1)], [y])
    return y
Beispiel #2
0
def _test_loop():
    x = ops.Const(5)
    y = ops.Const(0)
    with ops.loop():
        ops.stop_if(ops.EQ([x, ops.Const(0)]))
        ops.Add([x, ops.Const(-1)], [x])
        ops.Add([y, ops.Const(1)], [y])
    return y
Beispiel #3
0
def _test_inner_stop(x):
    ops.stop_if(ops.LT([x, ops.Const(5)]))
Beispiel #4
0
def _test_inner_stop(x):
    ops.stop_if(ops.LT([x, ops.Const(5)]))