From 5d90bbaac9b046a34562fa799a2f88cbe6edc2ae Mon Sep 17 00:00:00 2001 From: Kay Zhu Date: Wed, 7 Jun 2017 14:26:23 -0700 Subject: [XLA] Disable constant_folding in test base, so that intended test code paths would not be elided by constant_folding pass. PiperOrigin-RevId: 158317641 --- tensorflow/compiler/xla/tests/client_library_test_base.cc | 9 +++++++++ 1 file changed, 9 insertions(+) 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 { -- cgit v1.2.3