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:
parent
255a314bad
commit
e323dc9a05
@ -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:
|
||||
|
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user