diff options
author | 2018-07-03 19:01:49 -0700 | |
---|---|---|
committer | 2018-07-03 19:06:26 -0700 | |
commit | 8779f768a3c0fa8d48c25f71d65513c208c77432 (patch) | |
tree | e11ec13b24f7b599449f90d234b9fdc5c6a46180 /tensorflow/compiler/xla/service/conditional_simplifier_test.cc | |
parent | 1e7dde8791c535bd09bda9f9ecbe8594aed4f4c6 (diff) |
[TF:XLA] Split literal_util into {literal, literal_util}.
Currently Literal classes sits in literal_util.{h,cc} instead of literal.{h,cc}.
It also contains helper functions that are better fit to be their own separate
class/namespace. This change starts this process by moving most static factory
methods to LiteralUtil namespace.
PiperOrigin-RevId: 203217065
Diffstat (limited to 'tensorflow/compiler/xla/service/conditional_simplifier_test.cc')
-rw-r--r-- | tensorflow/compiler/xla/service/conditional_simplifier_test.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tensorflow/compiler/xla/service/conditional_simplifier_test.cc b/tensorflow/compiler/xla/service/conditional_simplifier_test.cc index 68f6ffc6b7..834878426f 100644 --- a/tensorflow/compiler/xla/service/conditional_simplifier_test.cc +++ b/tensorflow/compiler/xla/service/conditional_simplifier_test.cc @@ -55,7 +55,7 @@ HloComputation* ConditionalSimplifierTest::MakeConditional(HloModule* module) { true_computation_builder.AddInstruction(HloInstruction::CreateParameter( 0, ShapeUtil::MakeShape(S32, {}), "param")); auto one = true_computation_builder.AddInstruction( - HloInstruction::CreateConstant(Literal::CreateR0<int32>(1))); + HloInstruction::CreateConstant(LiteralUtil::CreateR0<int32>(1))); true_computation_builder.AddInstruction(HloInstruction::CreateBinary( ShapeUtil::MakeShape(S32, {}), HloOpcode::kAdd, param, one)); @@ -73,7 +73,7 @@ HloComputation* ConditionalSimplifierTest::MakeConditional(HloModule* module) { HloInstruction::CreateParameter(0, ShapeUtil::MakeShape(S32, {}), "param")); auto forty_two = false_computation_builder.AddInstruction( - HloInstruction::CreateConstant(Literal::CreateR0<int32>(42))); + HloInstruction::CreateConstant(LiteralUtil::CreateR0<int32>(42))); false_computation_builder.AddInstruction(HloInstruction::CreateBinary( ShapeUtil::MakeShape(S32, {}), HloOpcode::kAdd, param, forty_two)); @@ -82,11 +82,11 @@ HloComputation* ConditionalSimplifierTest::MakeConditional(HloModule* module) { } auto false_instrn = builder.AddInstruction( - HloInstruction::CreateConstant(Literal::CreateR0<bool>(false))); + HloInstruction::CreateConstant(LiteralUtil::CreateR0<bool>(false))); auto false_param = builder.AddInstruction(HloInstruction::CreateParameter( 0, ShapeUtil::MakeShape(S32, {}), "false_param")); auto one = builder.AddInstruction( - HloInstruction::CreateConstant(Literal::CreateR0<int32>(1))); + HloInstruction::CreateConstant(LiteralUtil::CreateR0<int32>(1))); builder.AddInstruction(HloInstruction::CreateConditional( ShapeUtil::MakeShape(S32, {}), false_instrn, one, true_computation, @@ -106,7 +106,7 @@ TEST_F(ConditionalSimplifierTest, ConditionalWithControlDependency) { HloComputation* computation = MakeConditional(&module()); auto* true_op = computation->AddInstruction( - HloInstruction::CreateConstant(Literal::CreateR0<bool>(true))); + HloInstruction::CreateConstant(LiteralUtil::CreateR0<bool>(true))); TF_ASSERT_OK( true_op->AddControlDependencyTo(computation->root_instruction())); @@ -123,7 +123,7 @@ TEST_F(ConditionalSimplifierTest, NotRemovedIfContainsSend) { true_computation->AddInstruction(HloInstruction::CreateAfterAll({})); auto* send = true_computation->AddInstruction(HloInstruction::CreateSend( true_computation->AddInstruction( - HloInstruction::CreateConstant(Literal::CreateR0<bool>(true))), + HloInstruction::CreateConstant(LiteralUtil::CreateR0<bool>(true))), token, /*channel_id=*/0)); true_computation->AddInstruction(HloInstruction::CreateSendDone(send)); EXPECT_FALSE(ConditionalSimplifier().Run(&module()).ValueOrDie()); |