MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / while_loop_op

Method while_loop_op

tensorflow/python/tpu/tensor_tracer.py:256–272  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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):

Callers 2

_skip_opMethod · 0.80
_skip_tensorMethod · 0.80

Calls 1

loop_cond_opMethod · 0.80

Tested by

no test coverage detected