diff options
Diffstat (limited to 'tensorflow/python/framework/test_util.py')
-rw-r--r-- | tensorflow/python/framework/test_util.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tensorflow/python/framework/test_util.py b/tensorflow/python/framework/test_util.py index cfa5fe5e3e..1610214d54 100644 --- a/tensorflow/python/framework/test_util.py +++ b/tensorflow/python/framework/test_util.py @@ -986,8 +986,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 "")) |