[XLA:Python] Pick layouts of executable parameters based on sharded shapes.
[XLA:Python] Pick layouts of executable parameters based on sharded shapes.

When the parameters of an HLO computation have an OpSharding, we
should compute the layout based on the final sharded shape, not the
unsharded shape that appears in the HLO computation. This fixes a bug
where the layout of the actual argument that's passed in didn't match
the layout used during compilation.

I've tested this using prototype JAX code. There isn't currently good
infrastructure for writing an XLA client unit test.

PiperOrigin-RevId: 307137430
Change-Id: Ie8019b5210c0ae98ae443c3edf4a0ebcfbd6ee77

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