Move the logic to decide whether to enable partial batch handling into dataset
Move the logic to decide whether to enable partial batch handling into dataset

When partial batch handling is enabled, we should change the element spec to
have a unknown batch dimension. This will be done in a later change.

PiperOrigin-RevId: 332335319
Change-Id: Ibac3f2ae6928bbd84301ec084f23707e9a0228e5

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