aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/xla/service/hlo_instruction_test.cc
diff options
context:
space:
mode:
authorGravatar Justin Lebar <jlebar@google.com>2018-05-31 15:25:10 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-05-31 15:27:58 -0700
commit28f8cf5cf2281682f70f4674192f9f31d68c5ee1 (patch)
tree0c78949c8730e28df3516c794568df287918e940 /tensorflow/compiler/xla/service/hlo_instruction_test.cc
parent4f6074494d4bf77daac5749224017615bfca239f (diff)
[XLA] Check for identical backend configs in HloInstruction::Identical.
PiperOrigin-RevId: 198789495
Diffstat (limited to 'tensorflow/compiler/xla/service/hlo_instruction_test.cc')
-rw-r--r--tensorflow/compiler/xla/service/hlo_instruction_test.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/tensorflow/compiler/xla/service/hlo_instruction_test.cc b/tensorflow/compiler/xla/service/hlo_instruction_test.cc
index e91cf2076f..d1b6bc726d 100644
--- a/tensorflow/compiler/xla/service/hlo_instruction_test.cc
+++ b/tensorflow/compiler/xla/service/hlo_instruction_test.cc
@@ -1542,5 +1542,21 @@ ENTRY entry (param: s32[]) -> s32[] {
}
}
+TEST_F(HloInstructionTest, IdenticalAccountsForBackendConfig) {
+ const Shape shape = ShapeUtil::MakeShape(F32, {42});
+ HloComputation::Builder builder("test");
+ HloInstruction* p =
+ builder.AddInstruction(HloInstruction::CreateParameter(0, shape, "p"));
+
+ HloInstruction* add1 = builder.AddInstruction(
+ HloInstruction::CreateBinary(shape, HloOpcode::kAdd, p, p));
+ HloInstruction* add2 = builder.AddInstruction(
+ HloInstruction::CreateBinary(shape, HloOpcode::kAdd, p, p));
+
+ EXPECT_TRUE(add1->Identical(*add2));
+ add1->set_raw_backend_config_string("abc");
+ EXPECT_FALSE(add1->Identical(*add2));
+}
+
} // namespace
} // namespace xla