[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
This commit is contained in:
Justin Lebar 2019-05-15 08:57:22 -07:00 committed by TensorFlower Gardener
parent d6643e8819
commit 4a94c4047e
2 changed files with 8 additions and 2 deletions

View File

@ -143,6 +143,11 @@ std::unique_ptr<VerifiedHloModule> HloTestBase::CreateNewVerifiedModule(
backend().compiler()->ShapeSizeBytesFunction());
}
StatusOr<std::unique_ptr<VerifiedHloModule>>
HloTestBase::ParseAndReturnVerifiedModule(absl::string_view hlo_text) {
return ParseAndReturnVerifiedModule(hlo_text, GetModuleConfigForTest());
}
StatusOr<std::unique_ptr<VerifiedHloModule>>
HloTestBase::ParseAndReturnVerifiedModule(absl::string_view hlo_text,
const HloModuleConfig& config) {

View File

@ -114,8 +114,9 @@ class HloTestBase : public ::testing::Test {
// Parses the given string and returns module as a VerifiedHloModule.
StatusOr<std::unique_ptr<VerifiedHloModule>> ParseAndReturnVerifiedModule(
absl::string_view hlo_text,
const HloModuleConfig& config = HloModuleConfig());
absl::string_view hlo_text);
StatusOr<std::unique_ptr<VerifiedHloModule>> 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