From 886229e977afbc34ec8d52ad6243b743547c8678 Mon Sep 17 00:00:00 2001 From: Blake Hechtman Date: Thu, 8 Oct 2020 08:38:25 -0700 Subject: [PATCH] [XLA] log a WARNING for out of range F64 constants instead of a check failure. PiperOrigin-RevId: 336091777 Change-Id: I4344ac47d23102e6092d72e7fe665c5d8505f02a --- tensorflow/compiler/xla/util.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tensorflow/compiler/xla/util.cc b/tensorflow/compiler/xla/util.cc index 4034e5fdd27..6e7deda13f0 100644 --- a/tensorflow/compiler/xla/util.cc +++ b/tensorflow/compiler/xla/util.cc @@ -374,7 +374,9 @@ std::pair SplitF64ToF32(double x) { // 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