In Graph constructor, use `FunctionLibraryDefinition::num_functions()` to get number of functions.
In Graph constructor, use `FunctionLibraryDefinition::num_functions()` to get number of functions.

Previously, we were converting the FunctionLibraryDefinition to a FunctionDefLibrary proto to read out its number of functions, which incurs heavy allocation and deallocation costs when there are many functions.

PiperOrigin-RevId: 274255340

aam-at/tensorflow,aam-at/tensorflow,gunan/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,aam-at/tensorflow,ppwwyyxx/tensorflow,gunan/tensorflow,renyi533/tensorflow,adit-chandra/tensorflow,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-pywrap_saved_model,freedomtan/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow,paolodedios/tensorflow,annarev/tensorflow,annarev/tensorflow,yongtang/tensorflow,petewarden/tensorflow,adit-chandra/tensorflow,jhseu/tensorflow,tensorflow/tensorflow-pywrap_saved_model,sarvex/tensorflow,gautam1858/tensorflow,jhseu/tensorflow,freedomtan/tensorflow,gunan/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-experimental_link_static_libraries_once,davidzchen/tensorflow,xzturn/tensorflow,frreiss/tensorflow-fred,yongtang/tensorflow,freedomtan/tensorflow,annarev/tensorflow,annarev/tensorflow,aldian/tensorflow,paolodedios/tensorflow,xzturn/tensorflow,jhseu/tensorflow,annarev/tensorflow,adit-chandra/tensorflow,renyi533/tensorflow,annarev/tensorflow,paolodedios/tensorflow,cxxgtxy/tensorflow,yongtang/tensorflow,renyi533/tensorflow,gunan/tensorflow,jhseu/tensorflow,yongtang/tensorflow,arborh/tensorflow,Intel-tensorflow/tensorflow,gautam1858/tensorflow,arborh/tensorflow,aam-at/tensorflow,yongtang/tensorflow,frreiss/tensorflow-fred,karllessard/tensorflow,yongtang/tensorflow,arborh/tensorflow,sarvex/tensorflow,paolodedios/tensorflow,petewarden/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow-pywrap_saved_model,arborh/tensorflow,sarvex/tensorflow,Intel-Corporation/tensorflow,annarev/tensorflow,aam-at/tensorflow,tensorflow/tensorflow,karllessard/tensorflow,arborh/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,gunan/tensorflow,petewarden/tensorflow,freedomtan/tensorflow,xzturn/tensorflow,Intel-tensorflow/tensorflow,karllessard/tensorflow,gunan/tensorflow,xzturn/tensorflow,gunan/tensorflow,aldian/tensorflow,gautam1858/tensorflow,yongtang/tensorflow,xzturn/tensorflow,adit-chandra/tensorflow,freedomtan/tensorflow,davidzchen/tensorflow,aam-at/tensorflow,Intel-tensorflow/tensorflow,annarev/tensorflow,Intel-tensorflow/tensorflow,ppwwyyxx/tensorflow,tensorflow/tensorflow,freedomtan/tensorflow,renyi533/tensorflow,frreiss/tensorflow-fred,davidzchen/tensorflow,tensorflow/tensorflow,annarev/tensorflow,tensorflow/tensorflow-pywrap_saved_model,petewarden/tensorflow,Intel-tensorflow/tensorflow,aam-at/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-pywrap_saved_model,adit-chandra/tensorflow,petewarden/tensorflow,annarev/tensorflow,gautam1858/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,renyi533/tensorflow,sarvex/tensorflow,karllessard/tensorflow,davidzchen/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,gautam1858/tensorflow,paolodedios/tensorflow,cxxgtxy/tensorflow,arborh/tensorflow,aam-at/tensorflow,davidzchen/tensorflow,davidzchen/tensorflow,Intel-Corporation/tensorflow,sarvex/tensorflow,gunan/tensorflow,frreiss/tensorflow-fred,gunan/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,ppwwyyxx/tensorflow,freedomtan/tensorflow,Intel-Corporation/tensorflow,ppwwyyxx/tensorflow,xzturn/tensorflow,gautam1858/tensorflow,cxxgtxy/tensorflow,yongtang/tensorflow,arborh/tensorflow,gunan/tensorflow,cxxgtxy/tensorflow,jhseu/tensorflow,aam-at/tensorflow,adit-chandra/tensorflow,xzturn/tensorflow,davidzchen/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-pywrap_saved_model,ppwwyyxx/tensorflow,frreiss/tensorflow-fred,cxxgtxy/tensorflow,xzturn/tensorflow,tensorflow/tensorflow-pywrap_saved_model,Intel-tensorflow/tensorflow,aam-at/tensorflow,freedomtan/tensorflow,tensorflow/tensorflow-pywrap_saved_model,aldian/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow,Intel-Corporation/tensorflow,jhseu/tensorflow,sarvex/tensorflow,freedomtan/tensorflow,arborh/tensorflow,petewarden/tensorflow,jhseu/tensorflow,jhseu/tensorflow,karllessard/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,Intel-tensorflow/tensorflow,davidzchen/tensorflow,arborh/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow,frreiss/tensorflow-fred,paolodedios/tensorflow,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-experimental_link_static_libraries_once,karllessard/tensorflow,aldian/tensorflow,yongtang/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,xzturn/tensorflow,gunan/tensorflow,xzturn/tensorflow,cxxgtxy/tensorflow,ppwwyyxx/tensorflow,renyi533/tensorflow,adit-chandra/tensorflow,aldian/tensorflow,Intel-Corporation/tensorflow,Intel-Corporation/tensorflow,Intel-tensorflow/tensorflow,freedomtan/tensorflow,cxxgtxy/tensorflow,adit-chandra/tensorflow,renyi533/tensorflow,renyi533/tensorflow,petewarden/tensorflow,renyi533/tensorflow,renyi533/tensorflow,ppwwyyxx/tensorflow,tensorflow/tensorflow,petewarden/tensorflow,karllessard/tensorflow,karllessard/tensorflow,petewarden/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow,adit-chandra/tensorflow,freedomtan/tensorflow,arborh/tensorflow,davidzchen/tensorflow,renyi533/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,yongtang/tensorflow,xzturn/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,sarvex/tensorflow,jhseu/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,aldian/tensorflow,yongtang/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,aldian/tensorflow,karllessard/tensorflow,davidzchen/tensorflow,frreiss/tensorflow-fred,paolodedios/tensorflow,Intel-Corporation/tensorflow,Intel-Corporation/tensorflow,jhseu/tensorflow,tensorflow/tensorflow,davidzchen/tensorflow,cxxgtxy/tensorflow,frreiss/tensorflow-fred,adit-chandra/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow,frreiss/tensorflow-fred,Intel-tensorflow/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,ppwwyyxx/tensorflow,gautam1858/tensorflow,freedomtan/tensorflow,sarvex/tensorflow,arborh/tensorflow,karllessard/tensorflow,gunan/tensorflow,karllessard/tensorflow,aldian/tensorflow,davidzchen/tensorflow,paolodedios/tensorflow,annarev/tensorflow,renyi533/tensorflow,gautam1858/tensorflow,paolodedios/tensorflow,jhseu/tensorflow,adit-chandra/tensorflow,gautam1858/tensorflow,aam-at/tensorflow,gautam1858/tensorflow,ppwwyyxx/tensorflow,frreiss/tensorflow-fred,petewarden/tensorflow,xzturn/tensorflow,ppwwyyxx/tensorflow,gautam1858/tensorflow,ppwwyyxx/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,aam-at/tensorflow,gautam1858/tensorflow,arborh/tensorflow,frreiss/tensorflow-fred,adit-chandra/tensorflow,jhseu/tensorflow,frreiss/tensorflow-fred,ppwwyyxx/tensorflow,tensorflow/tensorflow-pywrap_saved_model,petewarden/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-pywrap_tf_optimizer,petewarden/tensorflow