From c4b3910052c977ff602d2145d47772345e407a83 Mon Sep 17 00:00:00 2001 From: "A. Unique TensorFlower" Date: Wed, 22 Jan 2020 09:23:12 -0800 Subject: [PATCH] Internal change PiperOrigin-RevId: 290967854 Change-Id: I3c2d64e64414a805555bd3a5228d277199163ce3 --- tensorflow/python/kernel_tests/cast_op_test.py | 7 ------- tensorflow/python/ops/math_ops.py | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/tensorflow/python/kernel_tests/cast_op_test.py b/tensorflow/python/kernel_tests/cast_op_test.py index f26a1b6b58d..e9be8e7d5f7 100644 --- a/tensorflow/python/kernel_tests/cast_op_test.py +++ b/tensorflow/python/kernel_tests/cast_op_test.py @@ -213,13 +213,6 @@ class CastOpTest(test.TestCase): err = gradient_checker.compute_gradient_error(x, [], y, []) self.assertLess(err, 1e-3) - def testPythonDataTypes(self): - with self.cached_session(): - # GitHub issue 35938, a of 0.2 is for python native type. - a = 0.2 - b = math_ops.cast(a, dtypes.float64) - self.assertAllEqual(a, self.evaluate(b)) - class SparseTensorCastTest(test.TestCase): diff --git a/tensorflow/python/ops/math_ops.py b/tensorflow/python/ops/math_ops.py index b717077a80d..ee7b1194610 100644 --- a/tensorflow/python/ops/math_ops.py +++ b/tensorflow/python/ops/math_ops.py @@ -745,7 +745,7 @@ def cast(x, dtype, name=None): # ops.convert_to_tensor(x, dtype=dtype, ...) here, but that # allows some conversions that cast() can't do, e.g. casting numbers to # strings. - x = ops.convert_to_tensor(x, dtype_hint=base_type, name="x") + x = ops.convert_to_tensor(x, name="x") if x.dtype.base_dtype != base_type: x = gen_math_ops.cast(x, base_type, name=name) if x.dtype.is_complex and base_type.is_floating: