Commit 10430cf1 authored by Justin Lebar's avatar Justin Lebar Committed by TensorFlower Gardener
Browse files

[XLA] Handle denormals explicitly in exhaustive_f32_elementwise_op_test.

Previously, we expected that fn(x) would return something close to std::fn(x),
even if x was denormal.  Now, we accept a result that's close to either
std::fn(x) or std::fn(0).

As an example of why we need this fix, let x be a negative denormal, and
consider log(x).  log of any negative number (other than -0) should be nan.
But log(+/-0) is -inf.

XLA:CPU (and indeed, all of TF) runs in a mode where if x is denormal, x == 0
is true.  So although XLA:CPU's generated code correctly handles negative
denormal inputs to log, it's thwarted by this hardware mode and returns -inf
for log(x).
PiperOrigin-RevId: 231872731
parent 3dd58ab5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment