diff options
author | Dimitris Vardoulakis <dimvar@google.com> | 2018-08-22 13:27:04 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-08-22 13:34:03 -0700 |
commit | 0454c5051d7b8b85699065d9528a1633587db994 (patch) | |
tree | 09525d322fbc330652d933dc95a664c2fb3337a6 /tensorflow/compiler/xla/service/hlo_computation.cc | |
parent | a3960a0eeffac9467a5b3d4b525007d83ae137de (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.cc | 3 |
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) { |