Make tf.contrib.crf compatible with TPUs by using utils.smart_cond instead of tf.cond, which allows the static shape to be propagated correctly when available.
Make tf.contrib.crf compatible with TPUs by using utils.smart_cond instead of tf.cond, which allows the static shape to be propagated correctly when available.

PiperOrigin-RevId: 215034102

hfp/tensorflow-xsmm,hfp/tensorflow-xsmm,adit-chandra/tensorflow,chemelnucfin/tensorflow,jbedorf/tensorflow,hfp/tensorflow-xsmm,tensorflow/tensorflow-pywrap_tf_optimizer,DavidNorman/tensorflow,sarvex/tensorflow,hfp/tensorflow-xsmm,renyi533/tensorflow,petewarden/tensorflow,frreiss/tensorflow-fred,ppwwyyxx/tensorflow,dancingdan/tensorflow,hehongliang/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow,kobejean/tensorflow,Intel-tensorflow/tensorflow,kevin-coder/tensorflow-fork,jendap/tensorflow,xzturn/tensorflow,tensorflow/tensorflow-pywrap_saved_model,frreiss/tensorflow-fred,girving/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,asimshankar/tensorflow,annarev/tensorflow,jendap/tensorflow,apark263/tensorflow,kevin-coder/tensorflow-fork,asimshankar/tensorflow,brchiu/tensorflow,ghchinoy/tensorflow,renyi533/tensorflow,petewarden/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,adit-chandra/tensorflow,tensorflow/tensorflow,yongtang/tensorflow,davidzchen/tensorflow,alsrgv/tensorflow,renyi533/tensorflow,davidzchen/tensorflow,dongjoon-hyun/tensorflow,dancingdan/tensorflow,Intel-tensorflow/tensorflow,xzturn/tensorflow,yongtang/tensorflow,paolodedios/tensorflow,theflofly/tensorflow,Bismarrck/tensorflow,snnn/tensorflow,kobejean/tensorflow,DavidNorman/tensorflow,cxxgtxy/tensorflow,Intel-tensorflow/tensorflow,jhseu/tensorflow,adit-chandra/tensorflow,snnn/tensorflow,kobejean/tensorflow,chemelnucfin/tensorflow,tensorflow/tensorflow-pywrap_saved_model,seanli9jan/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,jhseu/tensorflow,adit-chandra/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-experimental_link_static_libraries_once,snnn/tensorflow,aldian/tensorflow,paolodedios/tensorflow,sarvex/tensorflow,arborh/tensorflow,Intel-Corporation/tensorflow,aam-at/tensorflow,aam-at/tensorflow,davidzchen/tensorflow,gautam1858/tensorflow,asimshankar/tensorflow,adit-chandra/tensorflow,girving/tensorflow,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow,jbedorf/tensorflow,gautam1858/tensorflow,karllessard/tensorflow,seanli9jan/tensorflow,dancingdan/tensorflow,apark263/tensorflow,adit-chandra/tensorflow,chemelnucfin/tensorflow,snnn/tensorflow,paolodedios/tensorflow,yongtang/tensorflow,cxxgtxy/tensorflow,tensorflow/tensorflow,jhseu/tensorflow,apark263/tensorflow,jendap/tensorflow,seanli9jan/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,gunan/tensorflow,tensorflow/tensorflow-pywrap_saved_model,davidzchen/tensorflow,hfp/tensorflow-xsmm,asimshankar/tensorflow,DavidNorman/tensorflow,karllessard/tensorflow,davidzchen/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,annarev/tensorflow,seanli9jan/tensorflow,kevin-coder/tensorflow-fork,cxxgtxy/tensorflow,hfp/tensorflow-xsmm,gunan/tensorflow,alsrgv/tensorflow,yongtang/tensorflow,hfp/tensorflow-xsmm,jhseu/tensorflow,Bismarrck/tensorflow,DavidNorman/tensorflow,yongtang/tensorflow,tensorflow/tensorflow,girving/tensorflow,kevin-coder/tensorflow-fork,snnn/tensorflow,hfp/tensorflow-xsmm,ghchinoy/tensorflow,kobejean/tensorflow,freedomtan/tensorflow,paolodedios/tensorflow,ageron/tensorflow,renyi533/tensorflow,petewarden/tensorflow,jbedorf/tensorflow,ageron/tensorflow,ppwwyyxx/tensorflow,jhseu/tensorflow,ppwwyyxx/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,girving/tensorflow,yongtang/tensorflow,ageron/tensorflow,kobejean/tensorflow,dongjoon-hyun/tensorflow,ghchinoy/tensorflow,adit-chandra/tensorflow,seanli9jan/tensorflow,frreiss/tensorflow-fred,arborh/tensorflow,jbedorf/tensorflow,freedomtan/tensorflow,brchiu/tensorflow,freedomtan/tensorflow,alshedivat/tensorflow,alsrgv/tensorflow,ghchinoy/tensorflow,davidzchen/tensorflow,arborh/tensorflow,ageron/tensorflow,adit-chandra/tensorflow,alsrgv/tensorflow,brchiu/tensorflow,jendap/tensorflow,annarev/tensorflow,chemelnucfin/tensorflow,ghchinoy/tensorflow,snnn/tensorflow,annarev/tensorflow,jendap/tensorflow,arborh/tensorflow,tensorflow/tensorflow,arborh/tensorflow,ghchinoy/tensorflow,Bismarrck/tensorflow,ppwwyyxx/tensorflow,yongtang/tensorflow,chemelnucfin/tensorflow,asimshankar/tensorflow,arborh/tensorflow,theflofly/tensorflow,gautam1858/tensorflow,seanli9jan/tensorflow,snnn/tensorflow,aam-at/tensorflow,ageron/tensorflow,apark263/tensorflow,kobejean/tensorflow,apark263/tensorflow,DavidNorman/tensorflow,brchiu/tensorflow,alshedivat/tensorflow,Intel-tensorflow/tensorflow,arborh/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,Bismarrck/tensorflow,kobejean/tensorflow,hehongliang/tensorflow,hehongliang/tensorflow,kevin-coder/tensorflow-fork,girving/tensorflow,Intel-Corporation/tensorflow,karllessard/tensorflow,DavidNorman/tensorflow,annarev/tensorflow,jendap/tensorflow,gunan/tensorflow,renyi533/tensorflow,Intel-Corporation/tensorflow,alshedivat/tensorflow,paolodedios/tensorflow,alshedivat/tensorflow,petewarden/tensorflow,girving/tensorflow,sarvex/tensorflow,freedomtan/tensorflow,frreiss/tensorflow-fred,paolodedios/tensorflow,alshedivat/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,gunan/tensorflow,davidzchen/tensorflow,asimshankar/tensorflow,hehongliang/tensorflow,theflofly/tensorflow,cxxgtxy/tensorflow,renyi533/tensorflow,paolodedios/tensorflow,ghchinoy/tensorflow,gautam1858/tensorflow,ghchinoy/tensorflow,ageron/tensorflow,theflofly/tensorflow,tensorflow/tensorflow-pywrap_saved_model,Intel-Corporation/tensorflow,xzturn/tensorflow,brchiu/tensorflow,karllessard/tensorflow,Bismarrck/tensorflow,hfp/tensorflow-xsmm,alsrgv/tensorflow,tensorflow/tensorflow,renyi533/tensorflow,chemelnucfin/tensorflow,gunan/tensorflow,frreiss/tensorflow-fred,dancingdan/tensorflow,davidzchen/tensorflow,jendap/tensorflow,frreiss/tensorflow-fred,DavidNorman/tensorflow,theflofly/tensorflow,karllessard/tensorflow,paolodedios/tensorflow,petewarden/tensorflow,aldian/tensorflow,tensorflow/tensorflow-pywrap_saved_model,DavidNorman/tensorflow,asimshankar/tensorflow,theflofly/tensorflow,frreiss/tensorflow-fred,jbedorf/tensorflow,yongtang/tensorflow,xzturn/tensorflow,jendap/tensorflow,aam-at/tensorflow,alsrgv/tensorflow,gautam1858/tensorflow,alshedivat/tensorflow,karllessard/tensorflow,cxxgtxy/tensorflow,ppwwyyxx/tensorflow,Intel-tensorflow/tensorflow,davidzchen/tensorflow,apark263/tensorflow,tensorflow/tensorflow,annarev/tensorflow,Bismarrck/tensorflow,gautam1858/tensorflow,ghchinoy/tensorflow,aldian/tensorflow,ppwwyyxx/tensorflow,snnn/tensorflow,adit-chandra/tensorflow,DavidNorman/tensorflow,dongjoon-hyun/tensorflow,alsrgv/tensorflow,asimshankar/tensorflow,arborh/tensorflow,kevin-coder/tensorflow-fork,brchiu/tensorflow,yongtang/tensorflow,annarev/tensorflow,freedomtan/tensorflow,Intel-tensorflow/tensorflow,ageron/tensorflow,aldian/tensorflow,apark263/tensorflow,jhseu/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,apark263/tensorflow,seanli9jan/tensorflow,karllessard/tensorflow,arborh/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,aldian/tensorflow,theflofly/tensorflow,jbedorf/tensorflow,tensorflow/tensorflow-pywrap_saved_model,gunan/tensorflow,freedomtan/tensorflow,xzturn/tensorflow,Intel-Corporation/tensorflow,dancingdan/tensorflow,xzturn/tensorflow,aam-at/tensorflow,snnn/tensorflow,kevin-coder/tensorflow-fork,arborh/tensorflow,ghchinoy/tensorflow,kevin-coder/tensorflow-fork,jhseu/tensorflow,frreiss/tensorflow-fred,hfp/tensorflow-xsmm,gautam1858/tensorflow,hehongliang/tensorflow,dongjoon-hyun/tensorflow,aam-at/tensorflow,freedomtan/tensorflow,renyi533/tensorflow,kobejean/tensorflow,snnn/tensorflow,cxxgtxy/tensorflow,ppwwyyxx/tensorflow,xzturn/tensorflow,ageron/tensorflow,DavidNorman/tensorflow,frreiss/tensorflow-fred,annarev/tensorflow,dancingdan/tensorflow,kobejean/tensorflow,jhseu/tensorflow,cxxgtxy/tensorflow,xzturn/tensorflow,gautam1858/tensorflow,jbedorf/tensorflow,frreiss/tensorflow-fred,hehongliang/tensorflow,hfp/tensorflow-xsmm,dancingdan/tensorflow,freedomtan/tensorflow,yongtang/tensorflow,jbedorf/tensorflow,dongjoon-hyun/tensorflow,theflofly/tensorflow,Intel-Corporation/tensorflow,jbedorf/tensorflow,ppwwyyxx/tensorflow,Bismarrck/tensorflow,apark263/tensorflow,Intel-tensorflow/tensorflow,xzturn/tensorflow,gautam1858/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,brchiu/tensorflow,ppwwyyxx/tensorflow,arborh/tensorflow,karllessard/tensorflow,ageron/tensorflow,petewarden/tensorflow,ppwwyyxx/tensorflow,alshedivat/tensorflow,tensorflow/tensorflow,renyi533/tensorflow,kevin-coder/tensorflow-fork,petewarden/tensorflow,aam-at/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow,petewarden/tensorflow,gautam1858/tensorflow,dongjoon-hyun/tensorflow,jendap/tensorflow,dancingdan/tensorflow,seanli9jan/tensorflow,girving/tensorflow,Intel-tensorflow/tensorflow,asimshankar/tensorflow,jhseu/tensorflow,brchiu/tensorflow,karllessard/tensorflow,asimshankar/tensorflow,jhseu/tensorflow,adit-chandra/tensorflow,Bismarrck/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,paolodedios/tensorflow,gunan/tensorflow,kobejean/tensorflow,sarvex/tensorflow,xzturn/tensorflow,theflofly/tensorflow,ageron/tensorflow,frreiss/tensorflow-fred,aam-at/tensorflow,brchiu/tensorflow,ghchinoy/tensorflow,sarvex/tensorflow,alsrgv/tensorflow,aldian/tensorflow,gunan/tensorflow,adit-chandra/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,annarev/tensorflow,adit-chandra/tensorflow,gunan/tensorflow,freedomtan/tensorflow,tensorflow/tensorflow-pywrap_saved_model,theflofly/tensorflow,dongjoon-hyun/tensorflow,tensorflow/tensorflow-pywrap_saved_model,alsrgv/tensorflow,davidzchen/tensorflow,gunan/tensorflow,gunan/tensorflow,ghchinoy/tensorflow,aam-at/tensorflow,seanli9jan/tensorflow,chemelnucfin/tensorflow,aam-at/tensorflow,chemelnucfin/tensorflow,jendap/tensorflow,brchiu/tensorflow,sarvex/tensorflow,kevin-coder/tensorflow-fork,freedomtan/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,Intel-Corporation/tensorflow,davidzchen/tensorflow,alshedivat/tensorflow,aldian/tensorflow,gautam1858/tensorflow,dongjoon-hyun/tensorflow,alsrgv/tensorflow,cxxgtxy/tensorflow,jbedorf/tensorflow,jhseu/tensorflow,seanli9jan/tensorflow,alsrgv/tensorflow,arborh/tensorflow,girving/tensorflow,frreiss/tensorflow-fred,Intel-Corporation/tensorflow,annarev/tensorflow,alsrgv/tensorflow,theflofly/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,Bismarrck/tensorflow,apark263/tensorflow,alshedivat/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-pywrap_saved_model,kobejean/tensorflow,jbedorf/tensorflow,seanli9jan/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,girving/tensorflow,tensorflow/tensorflow-pywrap_saved_model,ppwwyyxx/tensorflow,alshedivat/tensorflow,freedomtan/tensorflow,renyi533/tensorflow,dongjoon-hyun/tensorflow,snnn/tensorflow,ageron/tensorflow,sarvex/tensorflow,dancingdan/tensorflow,xzturn/tensorflow,jhseu/tensorflow,aam-at/tensorflow,DavidNorman/tensorflow,dancingdan/tensorflow,davidzchen/tensorflow,apark263/tensorflow,paolodedios/tensorflow,Bismarrck/tensorflow,petewarden/tensorflow,petewarden/tensorflow,gunan/tensorflow,DavidNorman/tensorflow,aam-at/tensorflow,chemelnucfin/tensorflow,paolodedios/tensorflow,theflofly/tensorflow,karllessard/tensorflow,Intel-tensorflow/tensorflow,sarvex/tensorflow,kevin-coder/tensorflow-fork,aldian/tensorflow,alshedivat/tensorflow,Bismarrck/tensorflow,brchiu/tensorflow,annarev/tensorflow,freedomtan/tensorflow,Intel-tensorflow/tensorflow,karllessard/tensorflow,hehongliang/tensorflow,jendap/tensorflow,yongtang/tensorflow,xzturn/tensorflow,ppwwyyxx/tensorflow,chemelnucfin/tensorflow,jbedorf/tensorflow,tensorflow/tensorflow,girving/tensorflow,chemelnucfin/tensorflow,gautam1858/tensorflow,dongjoon-hyun/tensorflow,petewarden/tensorflow,girving/tensorflow,dancingdan/tensorflow,renyi533/tensorflow,ageron/tensorflow,dongjoon-hyun/tensorflow,asimshankar/tensorflow,renyi533/tensorflow,petewarden/tensorflow,chemelnucfin/tensorflow