[xla] factor out some redundant code in XLA Python client
[xla] factor out some redundant code in XLA Python client

PiperOrigin-RevId: 247659426

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