diff --git a/tensorflow/python/kernel_tests/cwise_ops_test.py b/tensorflow/python/kernel_tests/cwise_ops_test.py index f89bc5a0348093fbab6ed27167c4be21655e3e63..cef8bfd17b0a10a9f6e6fba94adc6eb2a510c19f 100644 --- a/tensorflow/python/kernel_tests/cwise_ops_test.py +++ b/tensorflow/python/kernel_tests/cwise_ops_test.py @@ -1738,6 +1738,25 @@ class IsFiniteInfNanTest(tf.test.TestCase): def testDouble(self): self._testDtype(np.float64) + def testSqrt(self): + for dtype in [np.float16, np.float32, np.float64]: + fi = np.finfo(dtype) + for size in [1, 3, 4, 7, 8, 63, 64, 65]: + # For float32 Eigen uses Carmack's fast vectorized sqrt algorithm. + # It is not accurate for very large arguments, so we test for + # fi.max/100 instead of fi.max here. + for value in [fi.min, -2, -1, 0, fi.tiny, 1, 2, 1000, fi.max/100]: + x = np.full((size,), value, dtype=dtype) + np_y = np.sqrt(x) + np_nan = np.isnan(np_y) + with self.test_session(use_gpu=True): + tf_y = tf.sqrt(x) + tf_nan = tf.is_nan(tf_y) + if value < 0: + self.assertAllEqual(np_nan, tf_nan.eval()) + else: + self.assertAllCloseAccordingToType(np_y, tf_y.eval()) + class RoundingTest(tf.test.TestCase): diff --git a/tensorflow/workspace.bzl b/tensorflow/workspace.bzl index 1b555c40cd86092523114f57799b5af9066413e1..07fd0b3cff62e14755dbac070a6eabcdd9f95f12 100644 --- a/tensorflow/workspace.bzl +++ b/tensorflow/workspace.bzl @@ -14,8 +14,8 @@ def tf_workspace(path_prefix = "", tf_repo_name = ""): # These lines need to be changed when updating Eigen. They are parsed from # this file by the cmake and make builds to determine the eigen version and # hash. - eigen_version = "f6508f52a798" - eigen_sha256 = "9824d3beea839455e496ea472e4dcf05f7e25ec01dfb68e540fbfe522b609f72" + eigen_version = "1c7159a65db4" + eigen_sha256 = "b089a6eae493c32703c6beb5fdae9d64a7667c3a5440bae00ac8e517cc822e62" native.new_http_archive( name = "eigen_archive",