[XLA] log a WARNING for out of range F64 constants instead of a check failure.

PiperOrigin-RevId: 336091777
Change-Id: I4344ac47d23102e6092d72e7fe665c5d8505f02a
This commit is contained in:
Blake Hechtman 2020-10-08 08:38:25 -07:00 committed by TensorFlower Gardener
parent 471a3d4ce8
commit 886229e977

View File

@ -374,7 +374,9 @@ std::pair<float, float> 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