[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:
parent
471a3d4ce8
commit
886229e977
@ -374,7 +374,9 @@ std::pair<float, float> SplitF64ToF32(double x) {
|
|||||||
|
|
||||||
// Only values within the range of F32 are supported, unless it is infinity.
|
// Only values within the range of F32 are supported, unless it is infinity.
|
||||||
// Small values with large negative exponents would be rounded to zero.
|
// 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
|
// 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
|
// we are rounding to nearest with ties to even, the error introduced in
|
||||||
|
Loading…
Reference in New Issue
Block a user