[TF:XLA] Increase tolerance of ResizeImage test.
This test was flaky over 10% of the time with GPUs due to auto tuning. PiperOrigin-RevId: 230883941
This commit is contained in:
parent
52ae056566
commit
8a9c9c8f8f
@ -423,7 +423,7 @@ class ResizeNearestNeighborTest(xla_test.XLATestCase):
|
|||||||
out = sess.run(resized, {image: image_np[np.newaxis, :, :, np.newaxis]})
|
out = sess.run(resized, {image: image_np[np.newaxis, :, :, np.newaxis]})
|
||||||
if large_tolerance:
|
if large_tolerance:
|
||||||
self.assertAllClose(
|
self.assertAllClose(
|
||||||
expected[np.newaxis, :, :, np.newaxis], out, rtol=0.03, atol=0.1)
|
expected[np.newaxis, :, :, np.newaxis], out, rtol=2e-4, atol=2e-4)
|
||||||
else:
|
else:
|
||||||
self.assertAllClose(expected[np.newaxis, :, :, np.newaxis], out)
|
self.assertAllClose(expected[np.newaxis, :, :, np.newaxis], out)
|
||||||
|
|
||||||
@ -452,7 +452,7 @@ class ResizeNearestNeighborTest(xla_test.XLATestCase):
|
|||||||
np.array([[1, 2], [3, 4]], dtype=np.float32), [4, 4],
|
np.array([[1, 2], [3, 4]], dtype=np.float32), [4, 4],
|
||||||
expected=np.array(
|
expected=np.array(
|
||||||
[[1, 1, 2, 2], [1, 1, 2, 2], [3, 3, 4, 4], [3, 3, 4, 4]],
|
[[1, 1, 2, 2], [1, 1, 2, 2], [3, 3, 4, 4], [3, 3, 4, 4]],
|
||||||
dtype=np.float32))
|
dtype=np.float32), large_tolerance=True)
|
||||||
|
|
||||||
def testAlignCorners3x3To2x2(self):
|
def testAlignCorners3x3To2x2(self):
|
||||||
self._assertForwardOpMatchesExpected(
|
self._assertForwardOpMatchesExpected(
|
||||||
|
Loading…
Reference in New Issue
Block a user