aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Kay Zhu <kayzhu@google.com>2017-06-07 14:26:23 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-06-07 14:30:31 -0700
commit5d90bbaac9b046a34562fa799a2f88cbe6edc2ae (patch)
tree850fb7aa9b41dba81f381d3a0577c7242f817165
parentbff5e72da9f3df488c7d99149497ea41b6366944 (diff)
[XLA] Disable constant_folding in test base, so that intended test code paths
would not be elided by constant_folding pass. PiperOrigin-RevId: 158317641
-rw-r--r--tensorflow/compiler/xla/tests/client_library_test_base.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/tensorflow/compiler/xla/tests/client_library_test_base.cc b/tensorflow/compiler/xla/tests/client_library_test_base.cc
index 03552d7bbf..b96bb8f846 100644
--- a/tensorflow/compiler/xla/tests/client_library_test_base.cc
+++ b/tensorflow/compiler/xla/tests/client_library_test_base.cc
@@ -48,6 +48,15 @@ ClientLibraryTestBase::ClientLibraryTestBase(se::Platform* platform)
: client_(GetOrCreateLocalClientOrDie(platform)) {
*(execution_options_.mutable_debug_options()) =
legacy_flags::GetDebugOptionsFromFlags();
+
+ // Disabling constant_folding so that tests (usually written using Constants)
+ // will exercise the intended code paths, instead of being constant folded.
+ //
+ // TODO(b/38354253): Constant folding is currently disabled. Change tests to
+ // use Parameters instead of Constants, and re-enable constant folding by
+ // default.
+ execution_options_.mutable_debug_options()->add_xla_disable_hlo_passes(
+ "constant_folding");
}
string ClientLibraryTestBase::TestName() const {