Added short-curcuitting in Context.get_*_devices if device_type is None
Added short-curcuitting in Context.get_*_devices if device_type is None

This change also replaces a forloop with a list comprehension in all of
the methods.

PiperOrigin-RevId: 273539713

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