Skip to content

Commit

Permalink
[XLA] log a WARNING for out of range F64 constants instead of a check…
Browse files Browse the repository at this point in the history
… failure.

PiperOrigin-RevId: 336091777
Change-Id: I4344ac47d23102e6092d72e7fe665c5d8505f02a
  • Loading branch information
blakehechtman authored and tensorflower-gardener committed Oct 8, 2020
1 parent 471a3d4 commit 886229e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tensorflow/compiler/xla/util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 886229e

Please sign in to comment.