[XLA] log a WARNING for out of range F64 constants instead of a check failure.
PiperOrigin-RevId: 336091777
Change-Id: I4344ac47d23102e6092d72e7fe665c5d8505f02a
diff --git a/tensorflow/compiler/xla/util.cc b/tensorflow/compiler/xla/util.cc
index 4034e5f..6e7deda 100644
--- a/tensorflow/compiler/xla/util.cc
+++ b/tensorflow/compiler/xla/util.cc
@@ -374,7 +374,9 @@
// Only values within the range of F32 are supported, unless it is infinity.
// Small values with large negative exponents would be rounded to zero.
- CHECK(std::isfinite(x_f32)) << x;
+ if (!std::isfinite(x_f32)) {
+ LOG(WARNING) << "Out of range F64 constant detected: " << x;
+ }
// The high float is simply the double rounded to the nearest float. Because
// we are rounding to nearest with ties to even, the error introduced in