aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/python/framework/test_util.py
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/python/framework/test_util.py')
-rw-r--r--tensorflow/python/framework/test_util.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tensorflow/python/framework/test_util.py b/tensorflow/python/framework/test_util.py
index 6e3a35af3c..d796b0ebea 100644
--- a/tensorflow/python/framework/test_util.py
+++ b/tensorflow/python/framework/test_util.py
@@ -984,8 +984,9 @@ class TensorFlowTestCase(googletest.TestCase):
err: A float value.
msg: An optional string message to append to the failure message.
"""
+ # f1 == f2 is needed here as we might have: f1, f2 = inf, inf
self.assertTrue(
- math.fabs(f1 - f2) <= err,
+ f1 == f2 or math.fabs(f1 - f2) <= err,
"%f != %f +/- %f%s" % (f1, f2, err, " (%s)" % msg
if msg is not None else ""))