aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/xla/service/conditional_simplifier_test.cc
diff options
context:
space:
mode:
authorGravatar Mark Heffernan <meheff@google.com>2018-07-02 12:22:15 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-07-02 12:27:03 -0700
commit20e27ad56b95e19ebeb23e34db1aff22e0bd473e (patch)
tree0ff0a458b28a527acbc82b6ae1f5a36aeb96d1c8 /tensorflow/compiler/xla/service/conditional_simplifier_test.cc
parent0967cbb9a34b69ec14238802460971abbec9cbb4 (diff)
Change Send and Recv HLOs to take a token operand.
Send and Recv HLOs now have an additional required operand which must be token-shaped. XLA client interface for these operations is unchanged and will be updated in follow up CLs. PiperOrigin-RevId: 202993121
Diffstat (limited to 'tensorflow/compiler/xla/service/conditional_simplifier_test.cc')
-rw-r--r--tensorflow/compiler/xla/service/conditional_simplifier_test.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/tensorflow/compiler/xla/service/conditional_simplifier_test.cc b/tensorflow/compiler/xla/service/conditional_simplifier_test.cc
index c38719d50e..68f6ffc6b7 100644
--- a/tensorflow/compiler/xla/service/conditional_simplifier_test.cc
+++ b/tensorflow/compiler/xla/service/conditional_simplifier_test.cc
@@ -119,10 +119,12 @@ TEST_F(ConditionalSimplifierTest, NotRemovedIfContainsSend) {
ASSERT_EQ(conditional->opcode(), HloOpcode::kConditional);
auto* true_computation = conditional->true_computation();
+ auto* token =
+ true_computation->AddInstruction(HloInstruction::CreateAfterAll({}));
auto* send = true_computation->AddInstruction(HloInstruction::CreateSend(
true_computation->AddInstruction(
HloInstruction::CreateConstant(Literal::CreateR0<bool>(true))),
- /*channel_id=*/0));
+ token, /*channel_id=*/0));
true_computation->AddInstruction(HloInstruction::CreateSendDone(send));
EXPECT_FALSE(ConditionalSimplifier().Run(&module()).ValueOrDie());
}
@@ -133,8 +135,10 @@ TEST_F(ConditionalSimplifierTest, NotRemovedIfContainsRecv) {
ASSERT_EQ(conditional->opcode(), HloOpcode::kConditional);
auto* true_computation = conditional->true_computation();
+ auto* token =
+ true_computation->AddInstruction(HloInstruction::CreateAfterAll({}));
auto* recv = true_computation->AddInstruction(HloInstruction::CreateRecv(
- ShapeUtil::MakeShape(F32, {1}), /*channel_id=*/0));
+ ShapeUtil::MakeShape(F32, {1}), token, /*channel_id=*/0));
true_computation->AddInstruction(HloInstruction::CreateRecvDone(recv));
EXPECT_FALSE(ConditionalSimplifier().Run(&module()).ValueOrDie());
}