Returns true if op is one of the special ops of in a while loop. Args: op: A tf.Operation. Returns: True if the given op is one of [Switch, Merge, Enter, Exit, NextIteration, LoopCond], which are all building blocks for TF while loops.
(op)
| 254 | |
| 255 | @staticmethod |
| 256 | def while_loop_op(op): |
| 257 | """Returns true if op is one of the special ops of in a while loop. |
| 258 | |
| 259 | Args: |
| 260 | op: A tf.Operation. |
| 261 | |
| 262 | Returns: |
| 263 | True if the given op is one of [Switch, Merge, Enter, Exit, |
| 264 | NextIteration, LoopCond], which are all building blocks for TF while |
| 265 | loops. |
| 266 | """ |
| 267 | return (control_flow_util.IsLoopSwitch(op) or |
| 268 | control_flow_util.IsLoopMerge(op) or |
| 269 | control_flow_util.IsLoopEnter(op) or |
| 270 | control_flow_util.IsLoopExit(op) or |
| 271 | TensorTracer.loop_cond_op(op) or |
| 272 | op.type in ('RefNextIteration', 'NextIteration')) |
| 273 | |
| 274 | @staticmethod |
| 275 | def unsafe_op(op): |
no test coverage detected