Optimize the gradient function for tf.pow() and tf.squared_difference().
Optimize the gradient function for tf.pow() and tf.squared_difference().

This change uses the recently added graph-level cache for the results of `broadcast_gradient_args()` when the inputs have statically known shapes. Using this cache, it can avoid generating unnecessary ops, which shrinks the graph and improves startup time. In addition, we add special cases to optimize `tf.pow(x, scalar)`, and non-broadcasting `tf.squared_difference(x, y)`.

PiperOrigin-RevId: 260638889

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