Reduce Layer.__call__ overhead by ~5-10%.
Reduce Layer.__call__ overhead by ~5-10%.

Autocasting now only calls expensive nest.map_structure when Tensors need to be
autocast. In the common case where Tensors are passed with the correct dtype,
minimal work is performed.

PiperOrigin-RevId: 312800528
Change-Id: I25cc00c3309ea48b6fdc5ce6915701b960907008

yongtang/tensorflow,petewarden/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,freedomtan/tensorflow,frreiss/tensorflow-fred,gautam1858/tensorflow,cxxgtxy/tensorflow,aam-at/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,paolodedios/tensorflow,paolodedios/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow,aam-at/tensorflow,karllessard/tensorflow,cxxgtxy/tensorflow,freedomtan/tensorflow,sarvex/tensorflow,tensorflow/tensorflow-pywrap_saved_model,Intel-tensorflow/tensorflow,annarev/tensorflow,freedomtan/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,sarvex/tensorflow,aam-at/tensorflow,paolodedios/tensorflow,freedomtan/tensorflow,annarev/tensorflow,davidzchen/tensorflow,frreiss/tensorflow-fred,yongtang/tensorflow,annarev/tensorflow,karllessard/tensorflow,gautam1858/tensorflow,sarvex/tensorflow,karllessard/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow-pywrap_saved_model,cxxgtxy/tensorflow,davidzchen/tensorflow,gautam1858/tensorflow,frreiss/tensorflow-fred,tensorflow/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow-pywrap_saved_model,Intel-Corporation/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-experimental_link_static_libraries_once,sarvex/tensorflow,freedomtan/tensorflow,frreiss/tensorflow-fred,tensorflow/tensorflow-pywrap_tf_optimizer,Intel-Corporation/tensorflow,aldian/tensorflow,tensorflow/tensorflow,petewarden/tensorflow,Intel-Corporation/tensorflow,yongtang/tensorflow,karllessard/tensorflow,petewarden/tensorflow,cxxgtxy/tensorflow,cxxgtxy/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,paolodedios/tensorflow,aam-at/tensorflow,karllessard/tensorflow,tensorflow/tensorflow-pywrap_saved_model,yongtang/tensorflow,cxxgtxy/tensorflow,petewarden/tensorflow,Intel-tensorflow/tensorflow,petewarden/tensorflow,freedomtan/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,aldian/tensorflow,annarev/tensorflow,paolodedios/tensorflow,annarev/tensorflow,yongtang/tensorflow,yongtang/tensorflow,yongtang/tensorflow,sarvex/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow,gautam1858/tensorflow,frreiss/tensorflow-fred,frreiss/tensorflow-fred,tensorflow/tensorflow-pywrap_tf_optimizer,gautam1858/tensorflow,yongtang/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,gautam1858/tensorflow,annarev/tensorflow,davidzchen/tensorflow,Intel-tensorflow/tensorflow,karllessard/tensorflow,gautam1858/tensorflow,gautam1858/tensorflow,gautam1858/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow,davidzchen/tensorflow,davidzchen/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-pywrap_saved_model,petewarden/tensorflow,frreiss/tensorflow-fred,paolodedios/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow,aldian/tensorflow,davidzchen/tensorflow,davidzchen/tensorflow,freedomtan/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,davidzchen/tensorflow,petewarden/tensorflow,tensorflow/tensorflow-pywrap_saved_model,aldian/tensorflow,sarvex/tensorflow,aam-at/tensorflow,davidzchen/tensorflow,Intel-Corporation/tensorflow,tensorflow/tensorflow,freedomtan/tensorflow,Intel-tensorflow/tensorflow,aldian/tensorflow,aldian/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,Intel-tensorflow/tensorflow,tensorflow/tensorflow,davidzchen/tensorflow,freedomtan/tensorflow,yongtang/tensorflow,aam-at/tensorflow,Intel-Corporation/tensorflow,aam-at/tensorflow,annarev/tensorflow,petewarden/tensorflow,aldian/tensorflow,davidzchen/tensorflow,paolodedios/tensorflow,cxxgtxy/tensorflow,tensorflow/tensorflow-pywrap_saved_model,Intel-tensorflow/tensorflow,davidzchen/tensorflow,karllessard/tensorflow,aldian/tensorflow,Intel-Corporation/tensorflow,aam-at/tensorflow,frreiss/tensorflow-fred,petewarden/tensorflow,aam-at/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-experimental_link_static_libraries_once,yongtang/tensorflow,frreiss/tensorflow-fred,frreiss/tensorflow-fred,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow,aam-at/tensorflow,tensorflow/tensorflow-pywrap_saved_model,Intel-Corporation/tensorflow,karllessard/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,annarev/tensorflow,petewarden/tensorflow,freedomtan/tensorflow,karllessard/tensorflow,gautam1858/tensorflow,Intel-Corporation/tensorflow,annarev/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,freedomtan/tensorflow,yongtang/tensorflow,annarev/tensorflow,aam-at/tensorflow,Intel-tensorflow/tensorflow,sarvex/tensorflow,cxxgtxy/tensorflow,sarvex/tensorflow,frreiss/tensorflow-fred,tensorflow/tensorflow-pywrap_tf_optimizer,paolodedios/tensorflow,karllessard/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-pywrap_saved_model,petewarden/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-pywrap_saved_model,karllessard/tensorflow,freedomtan/tensorflow,annarev/tensorflow,gautam1858/tensorflow,aam-at/tensorflow,petewarden/tensorflow,frreiss/tensorflow-fred,gautam1858/tensorflow