diff --git a/tensorflow/compiler/tests/binary_ops_test.py b/tensorflow/compiler/tests/binary_ops_test.py index bfd0ce3d072..4d85ca67777 100644 --- a/tensorflow/compiler/tests/binary_ops_test.py +++ b/tensorflow/compiler/tests/binary_ops_test.py @@ -653,7 +653,13 @@ class BinaryOpsTest(xla_test.XLATestCase): divs = np.arange(-3, 3, .25, dtype=dtype).reshape(1, 24) np_result = np.true_divide(nums, divs) np_result[:, divs[0] == 0] = 0 - self._testBinary(gen_math_ops.div_no_nan, nums, divs, expected=np_result) + self._testBinary( + gen_math_ops.div_no_nan, + nums, + divs, + expected=np_result, + rtol=7e-15 if dtype == np.float64 else None, + atol=3.9e-15 if dtype == np.float64 else None) if dtype not in self.complex_types: # floordiv unsupported for complex. self._testBinary( diff --git a/tensorflow/compiler/tests/tensor_array_ops_test.py b/tensorflow/compiler/tests/tensor_array_ops_test.py index 99847e84c28..1bc88509542 100644 --- a/tensorflow/compiler/tests/tensor_array_ops_test.py +++ b/tensorflow/compiler/tests/tensor_array_ops_test.py @@ -164,7 +164,8 @@ class TensorArrayTest(xla_test.XLATestCase): dtype=tf_dtype, tensor_array_name="foo", size=3) # Unpack a matrix into vectors. - w1 = ta.unstack(convert([[1.0, 1.1], [2.0, 2.1], [3.0, 3.1]])) + w1 = ta.unstack( + convert([[1.0, 1.03125], [2.0, 2.03125], [3.0, 3.03125]])) r0 = w1.read(0) r1 = w1.read(1) r2 = w1.read(2) @@ -172,9 +173,9 @@ class TensorArrayTest(xla_test.XLATestCase): d0, d1, d2 = self.evaluate(xla.compile(fn)) - self.assertAllEqual(convert([1.0, 1.1]), d0) - self.assertAllEqual(convert([2.0, 2.1]), d1) - self.assertAllEqual(convert([3.0, 3.1]), d2) + self.assertAllEqual(convert([1.0, 1.03125]), d0) + self.assertAllEqual(convert([2.0, 2.03125]), d1) + self.assertAllEqual(convert([3.0, 3.03125]), d2) def fn(): # Reset ta because we're going to change the shape, else shape