Change division tests to use assertAllClose

Floating point operations do not guarantee bit for bit equality between different implementations, so just confirm that it's very close.

PiperOrigin-RevId: 354493959
Change-Id: Ic66e4f55322e65f5381bf25cebb56ec3b609b9ca
This commit is contained in:
Tres Popp 2021-01-29 02:13:07 -08:00 committed by TensorFlower Gardener
parent 255a314bad
commit e323dc9a05
2 changed files with 3 additions and 3 deletions

View File

@ -47,7 +47,7 @@ class DivisionTestCase(test.TestCase):
tensors.append((x, y))
def f(x, y):
self.assertEqual(x.dtype, y.dtype)
self.assertEqual(x, y)
self.assertAllClose(x, y)
checks.append(f)
with self.cached_session() as sess:

View File

@ -14,7 +14,7 @@
# ==============================================================================
"""Tests for division with division imported from __future__.
This file should be exactly the same as division_past_test.py except
This file should be exactly the same as division_future_test.py except
for the __future__ division line.
"""
@ -46,7 +46,7 @@ class DivisionTestCase(test.TestCase):
tensors.append((x, y))
def f(x, y):
self.assertEqual(x.dtype, y.dtype)
self.assertEqual(x, y)
self.assertAllClose(x, y)
checks.append(f)
with self.cached_session() as sess: