[tf.data] Change implementation of `from_generator` so that generator functions that only produce dense tensors use PyFunc-based mechanism (which is more efficient) and the EagerPyFunc-based mechanism is only used when support for composite tensors is needed.
[tf.data] Change implementation of `from_generator` so that generator functions that only produce dense tensors use PyFunc-based mechanism (which is more efficient) and the EagerPyFunc-based mechanism is only used when support for composite tensors is needed.

PiperOrigin-RevId: 337371087
Change-Id: Ib3c058a6ceeef330802cb41e92d61e71a3e98e8c

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