aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/xla/service/hlo_computation.cc
diff options
context:
space:
mode:
authorGravatar Dimitris Vardoulakis <dimvar@google.com>2018-08-22 13:27:04 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-08-22 13:34:03 -0700
commit0454c5051d7b8b85699065d9528a1633587db994 (patch)
tree09525d322fbc330652d933dc95a664c2fb3337a6 /tensorflow/compiler/xla/service/hlo_computation.cc
parenta3960a0eeffac9467a5b3d4b525007d83ae137de (diff)
[TF:XLA] Use unique_id_ to compare computations for equality quickly.
PiperOrigin-RevId: 209819199
Diffstat (limited to 'tensorflow/compiler/xla/service/hlo_computation.cc')
-rw-r--r--tensorflow/compiler/xla/service/hlo_computation.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/tensorflow/compiler/xla/service/hlo_computation.cc b/tensorflow/compiler/xla/service/hlo_computation.cc
index 70b18ff356..4c036ea1bf 100644
--- a/tensorflow/compiler/xla/service/hlo_computation.cc
+++ b/tensorflow/compiler/xla/service/hlo_computation.cc
@@ -682,6 +682,9 @@ ProgramShape HloComputation::ComputeProgramShape() const {
}
bool HloComputation::operator==(const HloComputation& other) const {
+ if (this == &other) {
+ return true;
+ }
std::set<std::pair<const HloInstruction*, const HloInstruction*>> visited;
std::function<bool(const HloInstruction*, const HloInstruction*)> eq =
[&visited, &eq](const HloInstruction* a, const HloInstruction* b) {