(self)
| 203 | |
| 204 | @test_util.run_deprecated_v1 |
| 205 | def testGradients(self): |
| 206 | t = [dtypes.float32, dtypes.float64, dtypes.complex64, dtypes.complex128] |
| 207 | for src_t in t: |
| 208 | for dst_t in t: |
| 209 | with self.cached_session(): |
| 210 | x = constant_op.constant(1.0, src_t) |
| 211 | z = array_ops.identity(x) |
| 212 | y = math_ops.cast(z, dst_t) |
| 213 | err = gradient_checker.compute_gradient_error(x, [], y, []) |
| 214 | self.assertLess(err, 1e-3) |
| 215 | |
| 216 | |
| 217 | class SparseTensorCastTest(test.TestCase): |
nothing calls this directly
no test coverage detected