Improve error message reporting for check_numerics gradient.
Improve error message reporting for check_numerics gradient.

At present the op message is only printed if the numeric check fails during
the op's 'forward' computation. If the check fails during the gradient, there is no
identifier on *which* op's gradient failed.

This is the Python equivalent of
https://github.com/tensorflow/tensorflow/commit/7e48bada

PiperOrigin-RevId: 222262823

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