From 4a94c4047ebae87d7cc2312e1601648c629ff221 Mon Sep 17 00:00:00 2001 From: Justin Lebar Date: Wed, 15 May 2019 08:57:22 -0700 Subject: [PATCH] [XLA] Pass correct HloModuleConfig in overload of RunAndCompare. Previously, this overload of RunAndCompare would use an empty HloModuleConfig. This isn't correct; it causes us to ignore any XLA_FLAGS, and it leaves constant folding enabled, which we usually want disabled in tests. PiperOrigin-RevId: 248342009 --- tensorflow/compiler/xla/tests/hlo_test_base.cc | 5 +++++ tensorflow/compiler/xla/tests/hlo_test_base.h | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/tensorflow/compiler/xla/tests/hlo_test_base.cc b/tensorflow/compiler/xla/tests/hlo_test_base.cc index f946ecb029b..79974723b8b 100644 --- a/tensorflow/compiler/xla/tests/hlo_test_base.cc +++ b/tensorflow/compiler/xla/tests/hlo_test_base.cc @@ -143,6 +143,11 @@ std::unique_ptr HloTestBase::CreateNewVerifiedModule( backend().compiler()->ShapeSizeBytesFunction()); } +StatusOr> +HloTestBase::ParseAndReturnVerifiedModule(absl::string_view hlo_text) { + return ParseAndReturnVerifiedModule(hlo_text, GetModuleConfigForTest()); +} + StatusOr> HloTestBase::ParseAndReturnVerifiedModule(absl::string_view hlo_text, const HloModuleConfig& config) { diff --git a/tensorflow/compiler/xla/tests/hlo_test_base.h b/tensorflow/compiler/xla/tests/hlo_test_base.h index 6c6fe34d1cc..7a78307a467 100644 --- a/tensorflow/compiler/xla/tests/hlo_test_base.h +++ b/tensorflow/compiler/xla/tests/hlo_test_base.h @@ -114,8 +114,9 @@ class HloTestBase : public ::testing::Test { // Parses the given string and returns module as a VerifiedHloModule. StatusOr> ParseAndReturnVerifiedModule( - absl::string_view hlo_text, - const HloModuleConfig& config = HloModuleConfig()); + absl::string_view hlo_text); + StatusOr> ParseAndReturnVerifiedModule( + absl::string_view hlo_text, const HloModuleConfig& config); // Runs the hlo_pass with the provided module and returns the result. This // function also verifies that the module remains unchanged when hlo_pass