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

Function IsCondMerge

tensorflow/python/ops/control_flow_util.py:133–147  ·  view source on GitHub ↗

Return true if `op` is the Merge for a conditional.

(op)

Source from the content-addressed store, hash-verified

131
132
133def IsCondMerge(op):
134 """Return true if `op` is the Merge for a conditional."""
135 if not IsMerge(op):
136 return False
137 if not op.inputs:
138 return False
139 # Merge nodes are not part of the cond control flow context that they
140 # represent, so consider the inputs to the merge of to determine if it is
141 # cond merge or not: A merge is a cond merge iff all its inputs are in
142 # cond contexts.
143 is_cond_merge = True
144 for i in op.inputs:
145 ctxt = GetOutputContext(i.op)
146 is_cond_merge = is_cond_merge and ctxt is not None and ctxt.IsCondContext()
147 return is_cond_merge
148
149
150def IsLoopSwitch(op):

Callers 1

IsLoopMergeFunction · 0.85

Calls 3

GetOutputContextFunction · 0.85
IsMergeFunction · 0.70
IsCondContextMethod · 0.45

Tested by

no test coverage detected