From 400dd49b4cbd44b0f1463cceb5ac42c457bdce32 Mon Sep 17 00:00:00 2001 From: Chris Leary Date: Thu, 10 May 2018 20:10:34 -0700 Subject: [XLA] Break out literal comparisons from testonly target. Moves methods from LiteralTestUtil::* to Literal::* where they have nothing to do with test infrastructure. Pares down the "void" variants of the LiteralTestUtil methods and consolidates to the version that return success/failure such that the values can be EXPECT_TRUE / ASSERT_TRUE asserted in the caller test cases. This way the literal comparison functionality can be used from cc_libraries that are not test only / cc_binary. PiperOrigin-RevId: 196209410 --- tensorflow/compiler/xla/service/hlo_constant_folding_test.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tensorflow/compiler/xla/service/hlo_constant_folding_test.cc') diff --git a/tensorflow/compiler/xla/service/hlo_constant_folding_test.cc b/tensorflow/compiler/xla/service/hlo_constant_folding_test.cc index 7b552ee5b1..5d05ccfc0b 100644 --- a/tensorflow/compiler/xla/service/hlo_constant_folding_test.cc +++ b/tensorflow/compiler/xla/service/hlo_constant_folding_test.cc @@ -149,7 +149,7 @@ TEST_F(HloConstantFoldingTest, Slice) { const int64 slice_limits[] = {10, 8, 6, 5, 9}; const int64 slice_strides[] = {1, 1, 1, 1, 1}; TF_ASSERT_OK_AND_ASSIGN(auto literal, - LiteralTestUtil::CreateRandomLiteral( + Literal::CreateRandomLiteral( ShapeUtil::MakeShape(F32, dimensions), 0.0, 1.0)); HloInstruction* literal_instruction = builder.AddInstruction( HloInstruction::CreateConstant(std::move(literal))); @@ -172,7 +172,7 @@ TEST_F(HloConstantFoldingTest, TransposeConstantFold) { HloComputation::Builder builder(TestName()); const int64 dimensions[] = {11, 8, 7, 5, 9}; TF_ASSERT_OK_AND_ASSIGN(auto literal, - LiteralTestUtil::CreateRandomLiteral( + Literal::CreateRandomLiteral( ShapeUtil::MakeShape(F32, dimensions), 0.0, 1.0)); auto literal_clone = literal->Literal::CloneToUnique(); HloInstruction* literal_instruction = builder.AddInstruction( -- cgit v1.2.3