[TF Python] Avoid leaking a reference to a _typeobject during concurrent first lookups.
[TF Python] Avoid leaking a reference to a _typeobject during concurrent first lookups.

Also switch to using tf_shared_lock on the initial cache lookup.

PiperOrigin-RevId: 224041975

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