[grappler] Do not forward inputs to _Retval nodes
PiperOrigin-RevId: 353903299 Change-Id: Ic1397f68555efdd7c7a4a2bf429589ef49cc2dea
This commit is contained in:
parent
c0948d3b29
commit
8e985babf8
@ -285,6 +285,11 @@ bool ConstantFolding::ForwardInputs(NodeDef* node,
|
|||||||
if (IsControlInput(consumer_input)) {
|
if (IsControlInput(consumer_input)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
// It is illegal to add control dependencies to _Retval nodes, so we
|
||||||
|
// can't bypass value producing `node` and forward inputs to `consumer`.
|
||||||
|
if (IsRetval(*consumer)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
int output_idx;
|
int output_idx;
|
||||||
const string input_node_name =
|
const string input_node_name =
|
||||||
ParseNodeName(consumer_input, &output_idx);
|
ParseNodeName(consumer_input, &output_idx);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user