Check type directly instead of trying to check element type
Check type directly instead of trying to check element type

Previously this attempted to check the element type, but NoneType does not have
an element type and so it didn't behave as expected. Swapping to TypeIs
checking instead.

PiperOrigin-RevId: 263009089

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