optimization on zeros_like_impl
optimization on zeros_like_impl

Instead of calling convert to tensor all the time, we first check it is a tensor, if those exist, no need to call. Otherwise, call.

This can help a lot on variable input.

In benchmark the performance is improved by ~30%

PiperOrigin-RevId: 275479807
Change-Id: I81bbb4e6bc5a7918704b13f96619e53217ce5fea

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