From 7dfabcc01c9c752747c473346bb3f8c1cd290ad1 Mon Sep 17 00:00:00 2001
From: "A. Unique TensorFlower" <gardener@tensorflow.org>
Date: Thu, 10 Aug 2017 13:28:30 -0700
Subject: [PATCH] Initialize ExecutionOptions in ComputeConstant to default
 values.

PiperOrigin-RevId: 164894867
---
 tensorflow/compiler/xla/service/BUILD      | 1 +
 tensorflow/compiler/xla/service/service.cc | 5 ++++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/tensorflow/compiler/xla/service/BUILD b/tensorflow/compiler/xla/service/BUILD
index 16628f5390a..5f6905c16e8 100644
--- a/tensorflow/compiler/xla/service/BUILD
+++ b/tensorflow/compiler/xla/service/BUILD
@@ -436,6 +436,7 @@ cc_library(
         ":user_computation",
         ":versioned_computation_handle",
         "//tensorflow/compiler/xla:executable_run_options",
+        "//tensorflow/compiler/xla:execution_options_util",
         "//tensorflow/compiler/xla:service_interface",
         "//tensorflow/compiler/xla:shape_layout",
         "//tensorflow/compiler/xla:shape_util",
diff --git a/tensorflow/compiler/xla/service/service.cc b/tensorflow/compiler/xla/service/service.cc
index ef29c7d5d13..75c9571d274 100644
--- a/tensorflow/compiler/xla/service/service.cc
+++ b/tensorflow/compiler/xla/service/service.cc
@@ -20,6 +20,7 @@ limitations under the License.
 #include <utility>
 #include <vector>
 
+#include "tensorflow/compiler/xla/execution_options_util.h"
 #include "tensorflow/compiler/xla/layout_util.h"
 #include "tensorflow/compiler/xla/legacy_flags/debug_options_flags.h"
 #include "tensorflow/compiler/xla/ptr_util.h"
@@ -1111,8 +1112,10 @@ tensorflow::Status Service::ComputeConstant(const ComputeConstantRequest* arg,
 
   TF_DCHECK_OK(ShapeUtil::ValidateShape(program_shape.result()));
 
-  ExecutionOptions execution_options;
+  ExecutionOptions execution_options = xla::CreateDefaultExecutionOptions();
   execution_options.mutable_debug_options()->set_xla_enable_fast_math(false);
+  execution_options.mutable_debug_options()->set_xla_backend_optimization_level(
+      0);
   *execution_options.mutable_shape_with_output_layout() =
       program_shape.result();