aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/xla/service/copy_insertion_test.cc
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2018-07-03 14:07:02 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-07-03 14:12:38 -0700
commitbdd84aa59d3bdedc42647711e401229f489c7d25 (patch)
tree695399ae3fed6bc65177f38493dee35f5f74e116 /tensorflow/compiler/xla/service/copy_insertion_test.cc
parenta6471888cc9dfe9c18d121149bc0516a3f423fbb (diff)
[TF:XLA] Split select HLO into array- and tuple-select.
Array select and tuple-select already are handled separately in all backends and HLO passes: Array select is an elementwise operation. The shapes of the to operands have the same dimensions. Tuple select does not define its own output, but instead forwards the true- or false- operand based on a scalar predicate operand. This CL reflects this by adding a new kTupleSelect HLO. The XLA builder interface stays the same and dispatches based on the operand shapes. No change in the operation semantics. This CL just splits the existing select operation into two opcodes and preserves the existing semantics. HLO cost analysis is fixed to handle the two ops appropriately. PiperOrigin-RevId: 203180342
Diffstat (limited to 'tensorflow/compiler/xla/service/copy_insertion_test.cc')
-rw-r--r--tensorflow/compiler/xla/service/copy_insertion_test.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/tensorflow/compiler/xla/service/copy_insertion_test.cc b/tensorflow/compiler/xla/service/copy_insertion_test.cc
index 7ae8799b61..105d117cac 100644
--- a/tensorflow/compiler/xla/service/copy_insertion_test.cc
+++ b/tensorflow/compiler/xla/service/copy_insertion_test.cc
@@ -211,7 +211,7 @@ TEST_F(CopyInsertionTest, AmbiguousPointsToSet) {
HloInstruction* pred = builder.AddInstruction(
HloInstruction::CreateConstant(Literal::CreateR0<bool>(false)));
builder.AddInstruction(HloInstruction::CreateTernary(
- tuple1->shape(), HloOpcode::kSelect, pred, tuple1, tuple2));
+ tuple1->shape(), HloOpcode::kTupleSelect, pred, tuple1, tuple2));
EXPECT_THAT(constant1->users(), UnorderedElementsAre(tuple1));
EXPECT_THAT(constant2->users(), UnorderedElementsAre(tuple1, tuple2));
@@ -382,7 +382,7 @@ TEST_F(CopyInsertionTest, AmbiguousTopLevelRoot) {
HloInstruction* pred = builder.AddInstruction(
HloInstruction::CreateConstant(Literal::CreateR0<bool>(false)));
HloInstruction* select = builder.AddInstruction(HloInstruction::CreateTernary(
- tuple1->shape(), HloOpcode::kSelect, pred, tuple1, tuple2));
+ tuple1->shape(), HloOpcode::kTupleSelect, pred, tuple1, tuple2));
HloInstruction* gte =
builder.AddInstruction(HloInstruction::CreateGetTupleElement(
ShapeUtil::GetSubshape(select->shape(), {0}), select, 0));
@@ -691,7 +691,7 @@ class WhileCopyInsertionTest : public CopyInsertionTest {
auto pred = builder.AddInstruction(
HloInstruction::CreateConstant(Literal::CreateR0<bool>(false)));
auto data_init = builder.AddInstruction(HloInstruction::CreateTernary(
- nested_tuple_shape_, HloOpcode::kSelect, pred, tuple1, tuple2));
+ nested_tuple_shape_, HloOpcode::kTupleSelect, pred, tuple1, tuple2));
return BuildWhileInstructionWithCustomInit(nested_loop_state_shape_,
data_init, &builder);