Using tf.maximum
with negative inf inputs as follows:
tf.maximum(-math.inf, -math.inf).eval()
gives the expected result -inf
However, tf.reduce_max
, on the same inputs:
tf.reduce_max([-math.inf, -math.inf]).eval()
gives: -3.40282e+38
which is the min float32.
For positive infinity inputs, both functions result in inf
. Is this a bug?
This turned out to be a bug in Eigen which has already been fixed and pushed out to TensorFlow.
The issue can be tracked here: https://github.com/tensorflow/tensorflow/issues/4131
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With