[xla] Improve validation of Broadcast shape
[xla] Improve validation of Broadcast shape

If one misreads the semantics of this instruction, it's easy to cause
an out of bounds access into the dimensions here. Add an extra check
to return a proper error to the user rather than crashing in that
case.

Ref #22130

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