Slightly ease comparison tolerances in cwise_ops_unary_test_gpu

PiperOrigin-RevId: 355814722
Change-Id: I8d4cd168389a55d71ad502a6062b608822798346
This commit is contained in:
Tres Popp 2021-02-05 02:58:22 -08:00 committed by TensorFlower Gardener
parent 08a3fba6df
commit f793216974

View File

@ -139,10 +139,10 @@ class UnaryOpTest(test.TestCase):
with test_util.use_gpu():
result = tf_func(ops.convert_to_tensor(x))
tf_gpu = self.evaluate(result)
if x.dtype == np.float16:
self.assertAllClose(np_ans, tf_gpu, rtol=1e-3, atol=1e-3)
else:
self.assertAllClose(np_ans, tf_gpu)
# Slightly increase the tolerance for float64 computations. This is
# desired for specifically lgamma but shouldn't be of concern for other
# functions.
self.assertAllCloseAccordingToType(np_ans, tf_gpu, atol=2e-6)
# TODO(zhifengc/ke): make gradient checker work on GPU.
def _compareSparseGpu(self, x, np_func, tf_func, tol):