Fix tests that prevent enabling the dependency optimizer in grappler.
- Most of these use constant inputs that cause the new optimizer to turn various backprop nodes into NoOps because their outputs are not consumed.
Improve or fix a few issues in the dependency optimizer:
- Prune duplicate control inputs. Don't add new control inputs if the target already has the source as a regular input.
- Don't turn Merge, Switch, Enter, Exit, NextIteration, _TPUExecute or _TPUCompile nodes into NoOps.
- Don't call ConstantFolding::AddControlDependency() when re-routing, since the nodes
in questions already have control inputs, so cannot be Switch nodes.
- Don't clear inputs from NoOps unless we know the fetch nodes.
PiperOrigin-RevId: 176523299
Loading
Please sign in to comment