In resource_variable_ops.copy_to_graph_uninitialized, instantiate `UninitializedVariable` under var.device's scope.
In resource_variable_ops.copy_to_graph_uninitialized, instantiate
`UninitializedVariable` under var.device's scope.

It was discovered that when using tf.saved_model.save with MultiWorkerMirroredStrategy, it is possible that a variable does not have device attribute and tf.distribute code errors out. This fixes it and a test that would have failed is added to cover such use case.

PiperOrigin-RevId: 276383534
Change-Id: I467bdaf5946da7dd1f3722c91a586830566608de

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