(self)
| 122 | return total, total_large, total_small, total_tiny |
| 123 | |
| 124 | def _actual_loop(self): |
| 125 | total = ops.Const(0) |
| 126 | total_large = ops.Const(0) |
| 127 | total_small = ops.Const(0) |
| 128 | total_tiny = ops.Const(0) |
| 129 | with ops.loop(10) as loop: |
| 130 | outer = ops.Mul([loop.iter(), ops.Const(10)]) |
| 131 | with ops.loop(loop.iter()) as inner: |
| 132 | val = ops.Add([outer, inner.iter()]) |
| 133 | with ops.If(ops.GE([val, ops.Const(80)])) as c: |
| 134 | ops.Add([total_large, val], [total_large]) |
| 135 | with c.Elif(ops.GE([val, ops.Const(50)])) as c: |
| 136 | ops.Add([total_small, val], [total_small]) |
| 137 | with c.Else(): |
| 138 | ops.Add([total_tiny, val], [total_tiny]) |
| 139 | ops.Add([total, val], total) |
| 140 | return [ |
| 141 | final_output(x) |
| 142 | for x in [total, total_large, total_small, total_tiny] |
| 143 | ] |
| 144 | |
| 145 | def test_net_multi_use(self): |
| 146 | with Task() as task: |
no test coverage detected