Add Python checks to prevent mixing ops from different while loops.
The executor can currently catch some errors like this by trying to reconstruct the while loop contexts by tracing the graph from enter nodes, but this doesn't catch everything and can cause hangs or other undesirable behavior. This change puts the check in Python and also provides better debugging information. In addition, this change refactors some logic from control_flow_ops.py to a new file, control_flow_util.py. This is so we can call CheckInputFromValidContext from ops.py without creating circular imports between ops.py and control_flow_ops.py. PiperOrigin-RevId: 178161679
Loading
Please sign in to comment