From e96c412005adba308ea3a57749c33566707a7067 Mon Sep 17 00:00:00 2001 From: Urs Koster Date: Fri, 5 Jun 2020 14:05:37 -0700 Subject: [PATCH] Ensure different distributions (e.g. from tf.random.normal and tf.random.uniform) are not considered identical. PiperOrigin-RevId: 314992733 Change-Id: Ib537e6c5311b07a6ed930f413bee9feefbd09e12 --- tensorflow/compiler/xla/service/hlo_instructions.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tensorflow/compiler/xla/service/hlo_instructions.cc b/tensorflow/compiler/xla/service/hlo_instructions.cc index 50e6b6bd884..bcc00d806da 100644 --- a/tensorflow/compiler/xla/service/hlo_instructions.cc +++ b/tensorflow/compiler/xla/service/hlo_instructions.cc @@ -1818,7 +1818,8 @@ bool HloRngInstruction::IdenticalSlowPath( const HloInstruction& other, const std::function& eq_computations) const { - return true; + const auto& casted_other = static_cast(other); + return distribution_ == casted_other.distribution_; } std::unique_ptr HloRngInstruction::CloneWithNewOperandsImpl(