In FunctionalizeCond, propagate cond state along control edge as well.
In FunctionalizeCond, propagate cond state along control edge as well.

Background:
1) we generate Switch node as grad for Merge node
2) control_flow_ops.tuple() is called for Switch node output in 1), generating a groups_deps NoOp node and a control_dependency Identity node.

Event sequence that will cause a bug:
1) we generate Switch node as grad for inner cond's Merge node. This Switch node has CondState [outer].
2) groups_deps NoOp is generated for the Switch in 1), we have a control edge from Switch to this group_deps, so this group_deps has CondState [outer].
3) we generate control_dependency Identity node. This control_dependency node has CondState [outer, inner] (because it has input data from inner cond in forward pass, which has CondState [outer, inner]).
4) we generate another Switch node as grad for inner cond's another Merge node.
5) another group_deps node is generated for the Switch node in 4). In the bug, this group_deps node has control dependency from control_dependency node in 3).
6) when we functionalize the inner cond in 4) and 5), we recognize group_deps node in 2) as an *external* control input to the inner cond, because the group_deps node in 2) has CondState [outer], while all other nodes in inner cond have CondState [outer, inner]. As a result, the group_deps node in 2) won't be removed, and neither will the Switch node in 1).
7) when we functionalize the outer cond, we will process the Switch node in 1). When we call AddSwitch() for it, a mismatching predicate error is raised.

The solution: in 2), we set the group_deps node's CondState to [outer, inner]. So it won't be an external control input to the inner cond, and will be removed when we finish functionalization of the inner cond.

PiperOrigin-RevId: 236217167

petewarden/tensorflow,aam-at/tensorflow,renyi533/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow,frreiss/tensorflow-fred,aldian/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-pywrap_tf_optimizer,jhseu/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-pywrap_saved_model,aam-at/tensorflow,theflofly/tensorflow,ageron/tensorflow,frreiss/tensorflow-fred,tensorflow/tensorflow,tensorflow/tensorflow-pywrap_saved_model,freedomtan/tensorflow,aldian/tensorflow,frreiss/tensorflow-fred,tensorflow/tensorflow-pywrap_tf_optimizer,petewarden/tensorflow,frreiss/tensorflow-fred,ageron/tensorflow,sarvex/tensorflow,kevin-coder/tensorflow-fork,renyi533/tensorflow,xzturn/tensorflow,sarvex/tensorflow,ppwwyyxx/tensorflow,annarev/tensorflow,ppwwyyxx/tensorflow,freedomtan/tensorflow,paolodedios/tensorflow,jhseu/tensorflow,annarev/tensorflow,gunan/tensorflow,annarev/tensorflow,gunan/tensorflow,aldian/tensorflow,aldian/tensorflow,tensorflow/tensorflow,aldian/tensorflow,kevin-coder/tensorflow-fork,cxxgtxy/tensorflow,Intel-Corporation/tensorflow,freedomtan/tensorflow,ageron/tensorflow,Intel-tensorflow/tensorflow,karllessard/tensorflow,Intel-tensorflow/tensorflow,sarvex/tensorflow,freedomtan/tensorflow,adit-chandra/tensorflow,DavidNorman/tensorflow,jhseu/tensorflow,frreiss/tensorflow-fred,ghchinoy/tensorflow,karllessard/tensorflow,kevin-coder/tensorflow-fork,tensorflow/tensorflow,petewarden/tensorflow,Intel-tensorflow/tensorflow,gunan/tensorflow,theflofly/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,theflofly/tensorflow,ppwwyyxx/tensorflow,xzturn/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,aam-at/tensorflow,yongtang/tensorflow,alsrgv/tensorflow,arborh/tensorflow,ageron/tensorflow,cxxgtxy/tensorflow,annarev/tensorflow,gautam1858/tensorflow,Intel-Corporation/tensorflow,Intel-tensorflow/tensorflow,alsrgv/tensorflow,jbedorf/tensorflow,frreiss/tensorflow-fred,tensorflow/tensorflow,Intel-tensorflow/tensorflow,DavidNorman/tensorflow,arborh/tensorflow,yongtang/tensorflow,tensorflow/tensorflow,ppwwyyxx/tensorflow,alsrgv/tensorflow,tensorflow/tensorflow-pywrap_saved_model,sarvex/tensorflow,yongtang/tensorflow,alsrgv/tensorflow,renyi533/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,freedomtan/tensorflow,gunan/tensorflow,ppwwyyxx/tensorflow,gautam1858/tensorflow,gunan/tensorflow,tensorflow/tensorflow-pywrap_saved_model,xzturn/tensorflow,davidzchen/tensorflow,sarvex/tensorflow,petewarden/tensorflow,Intel-Corporation/tensorflow,aam-at/tensorflow,renyi533/tensorflow,theflofly/tensorflow,kevin-coder/tensorflow-fork,kevin-coder/tensorflow-fork,renyi533/tensorflow,ghchinoy/tensorflow,jbedorf/tensorflow,Intel-Corporation/tensorflow,theflofly/tensorflow,yongtang/tensorflow,tensorflow/tensorflow-pywrap_saved_model,ppwwyyxx/tensorflow,gautam1858/tensorflow,theflofly/tensorflow,kevin-coder/tensorflow-fork,ageron/tensorflow,DavidNorman/tensorflow,jbedorf/tensorflow,aam-at/tensorflow,alsrgv/tensorflow,petewarden/tensorflow,karllessard/tensorflow,alsrgv/tensorflow,jhseu/tensorflow,jbedorf/tensorflow,karllessard/tensorflow,davidzchen/tensorflow,yongtang/tensorflow,yongtang/tensorflow,cxxgtxy/tensorflow,karllessard/tensorflow,gautam1858/tensorflow,karllessard/tensorflow,freedomtan/tensorflow,davidzchen/tensorflow,freedomtan/tensorflow,adit-chandra/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,alsrgv/tensorflow,renyi533/tensorflow,paolodedios/tensorflow,theflofly/tensorflow,davidzchen/tensorflow,jbedorf/tensorflow,gautam1858/tensorflow,gunan/tensorflow,ghchinoy/tensorflow,adit-chandra/tensorflow,sarvex/tensorflow,yongtang/tensorflow,cxxgtxy/tensorflow,Intel-tensorflow/tensorflow,arborh/tensorflow,ppwwyyxx/tensorflow,ghchinoy/tensorflow,annarev/tensorflow,aam-at/tensorflow,aam-at/tensorflow,jhseu/tensorflow,adit-chandra/tensorflow,annarev/tensorflow,gunan/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,ghchinoy/tensorflow,chemelnucfin/tensorflow,jbedorf/tensorflow,chemelnucfin/tensorflow,paolodedios/tensorflow,xzturn/tensorflow,xzturn/tensorflow,DavidNorman/tensorflow,ageron/tensorflow,davidzchen/tensorflow,chemelnucfin/tensorflow,paolodedios/tensorflow,jhseu/tensorflow,gautam1858/tensorflow,theflofly/tensorflow,jbedorf/tensorflow,DavidNorman/tensorflow,chemelnucfin/tensorflow,jbedorf/tensorflow,frreiss/tensorflow-fred,ghchinoy/tensorflow,arborh/tensorflow,ageron/tensorflow,paolodedios/tensorflow,ppwwyyxx/tensorflow,Intel-Corporation/tensorflow,freedomtan/tensorflow,jhseu/tensorflow,xzturn/tensorflow,renyi533/tensorflow,freedomtan/tensorflow,aldian/tensorflow,jbedorf/tensorflow,paolodedios/tensorflow,jhseu/tensorflow,petewarden/tensorflow,paolodedios/tensorflow,Intel-tensorflow/tensorflow,jbedorf/tensorflow,theflofly/tensorflow,adit-chandra/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,xzturn/tensorflow,alsrgv/tensorflow,karllessard/tensorflow,adit-chandra/tensorflow,DavidNorman/tensorflow,DavidNorman/tensorflow,cxxgtxy/tensorflow,arborh/tensorflow,paolodedios/tensorflow,karllessard/tensorflow,aam-at/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,sarvex/tensorflow,Intel-Corporation/tensorflow,chemelnucfin/tensorflow,ghchinoy/tensorflow,DavidNorman/tensorflow,gautam1858/tensorflow,alsrgv/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,arborh/tensorflow,freedomtan/tensorflow,tensorflow/tensorflow-pywrap_saved_model,ppwwyyxx/tensorflow,gunan/tensorflow,renyi533/tensorflow,paolodedios/tensorflow,arborh/tensorflow,frreiss/tensorflow-fred,Intel-tensorflow/tensorflow,yongtang/tensorflow,renyi533/tensorflow,ageron/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow,ghchinoy/tensorflow,renyi533/tensorflow,Intel-Corporation/tensorflow,adit-chandra/tensorflow,aam-at/tensorflow,Intel-tensorflow/tensorflow,cxxgtxy/tensorflow,chemelnucfin/tensorflow,annarev/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,adit-chandra/tensorflow,ageron/tensorflow,ghchinoy/tensorflow,petewarden/tensorflow,cxxgtxy/tensorflow,davidzchen/tensorflow,chemelnucfin/tensorflow,gunan/tensorflow,jbedorf/tensorflow,adit-chandra/tensorflow,DavidNorman/tensorflow,annarev/tensorflow,ageron/tensorflow,ppwwyyxx/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,chemelnucfin/tensorflow,ageron/tensorflow,gunan/tensorflow,DavidNorman/tensorflow,annarev/tensorflow,cxxgtxy/tensorflow,renyi533/tensorflow,chemelnucfin/tensorflow,freedomtan/tensorflow,arborh/tensorflow,frreiss/tensorflow-fred,Intel-tensorflow/tensorflow,karllessard/tensorflow,jbedorf/tensorflow,frreiss/tensorflow-fred,kevin-coder/tensorflow-fork,tensorflow/tensorflow,karllessard/tensorflow,theflofly/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,theflofly/tensorflow,gunan/tensorflow,sarvex/tensorflow,davidzchen/tensorflow,gautam1858/tensorflow,ghchinoy/tensorflow,chemelnucfin/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,DavidNorman/tensorflow,ghchinoy/tensorflow,kevin-coder/tensorflow-fork,alsrgv/tensorflow,jhseu/tensorflow,gautam1858/tensorflow,xzturn/tensorflow,kevin-coder/tensorflow-fork,karllessard/tensorflow,aldian/tensorflow,jhseu/tensorflow,kevin-coder/tensorflow-fork,ppwwyyxx/tensorflow,davidzchen/tensorflow,davidzchen/tensorflow,adit-chandra/tensorflow,xzturn/tensorflow,freedomtan/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,davidzchen/tensorflow,arborh/tensorflow,petewarden/tensorflow,kevin-coder/tensorflow-fork,xzturn/tensorflow,petewarden/tensorflow,gautam1858/tensorflow,arborh/tensorflow,chemelnucfin/tensorflow,aam-at/tensorflow,tensorflow/tensorflow-pywrap_saved_model,aam-at/tensorflow,renyi533/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,petewarden/tensorflow,Intel-Corporation/tensorflow,adit-chandra/tensorflow,gautam1858/tensorflow,ageron/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,xzturn/tensorflow,davidzchen/tensorflow,gunan/tensorflow,yongtang/tensorflow,arborh/tensorflow,tensorflow/tensorflow-pywrap_saved_model,petewarden/tensorflow,tensorflow/tensorflow-pywrap_saved_model,chemelnucfin/tensorflow,paolodedios/tensorflow,gautam1858/tensorflow,ppwwyyxx/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,xzturn/tensorflow,frreiss/tensorflow-fred,ghchinoy/tensorflow,davidzchen/tensorflow,annarev/tensorflow,frreiss/tensorflow-fred,petewarden/tensorflow,yongtang/tensorflow,alsrgv/tensorflow,aam-at/tensorflow,annarev/tensorflow,arborh/tensorflow,theflofly/tensorflow,tensorflow/tensorflow,yongtang/tensorflow,jhseu/tensorflow,jhseu/tensorflow,alsrgv/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow,aldian/tensorflow,tensorflow/tensorflow-pywrap_saved_model,DavidNorman/tensorflow,adit-chandra/tensorflow,tensorflow/tensorflow