aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/xla/service/hlo_constant_folding_test.cc
diff options
context:
space:
mode:
authorGravatar Chris Leary <leary@google.com>2018-05-10 20:10:34 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-05-10 20:13:33 -0700
commit400dd49b4cbd44b0f1463cceb5ac42c457bdce32 (patch)
tree033d23533d3f9e7551d6cfe6b5e43f342c77b685 /tensorflow/compiler/xla/service/hlo_constant_folding_test.cc
parent5a492ef9bbfa4bb93fcf0e2b2f8afa34d25d5236 (diff)
[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
Diffstat (limited to 'tensorflow/compiler/xla/service/hlo_constant_folding_test.cc')
-rw-r--r--tensorflow/compiler/xla/service/hlo_constant_folding_test.cc4
1 files changed, 2 insertions, 2 deletions
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<F32>(
+ Literal::CreateRandomLiteral<F32>(
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<F32>(
+ Literal::CreateRandomLiteral<F32>(
ShapeUtil::MakeShape(F32, dimensions), 0.0, 1.0));
auto literal_clone = literal->Literal::CloneToUnique();
HloInstruction* literal_instruction = builder.AddInstruction(