message: [XLA:Python] Prevent CHECK-failure when accessing the CompileOptions.device_assignment property when no device assignment is present.
diff: @@ -429,8 +429,13 @@ PYBIND11_MODULE(xla_extension, m) {
  })
  .def_property(
  "device_assignment",
  - [](const CompileOptions& options) {
  - return options.executable_build_options.device_assignment();
  + [](const CompileOptions& options)
  + -> absl::optional<DeviceAssignment> {
  + return options.executable_build_options.has_device_assignment()
  + ? absl::optional<DeviceAssignment>(
  + options.executable_build_options
  + .device_assignment())
  + : absl::nullopt;
  },
  [](CompileOptions& options,
  const DeviceAssignment& device_assignment) {
  @@ -465,8 +470,7 @@ PYBIND11_MODULE(xla_extension, m) {
  return local_device->client()->TransferToInfeedLocal(
  literal, local_device->device_ordinal());
  })
  - .def(
  - "transfer_from_outfeed",
  + .def("transfer_from_outfeed",
  [](const PjRtDevice& device,
  const Shape& shape) -> StatusOr<py::object> {
  GlobalPyRefManager()->CollectGarbage();
  