Stop execution of the current execution step if the condition `blob` is met. Example: ops.Print(a, 0) ops.stop_if(ops.LE([x, ops.Const(0)])) ops.Print(b, 0) In the example, 'b' will only be printed if the value
(self, blob)
| 260 | return self.stop_if(ops.Const(True)) |
| 261 | |
| 262 | def stop_if(self, blob): |
| 263 | """ |
| 264 | Stop execution of the current execution step if the |
| 265 | condition `blob` is met. |
| 266 | Example: |
| 267 | ops.Print(a, 0) |
| 268 | ops.stop_if(ops.LE([x, ops.Const(0)])) |
| 269 | ops.Print(b, 0) |
| 270 | In the example, 'b' will only be printed if the value of scalar |
| 271 | tensor 'x' is greater than 0. |
| 272 | """ |
| 273 | return NetBuilder.current().stop_if(blob) |
| 274 | |
| 275 | def loop(self, iters=None, name=None): |
| 276 | """ |