Improve the performance of ParseShapeStringInternal
Improve the performance of ParseShapeStringInternal

The previous implementation recompiled the shape regex at every call
what is an expensive opertaion. The new implementation improves the hlo
text parsing time for very large models for up to 9x by eliminating this
overhead.

PiperOrigin-RevId: 202454354

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