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

Only retrieve mask arg if Layer.call or Layer.compute_mask need it.
Skips checking for implicit masks entirely otherwise.

PiperOrigin-RevId: 313444769
Change-Id: Ife930d4c299dce6463836e0e238d236b7582b2ee

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