Tests cast(x) to dtype behaves the same as numpy.astype.
(self, x, dtype, use_gpu=False)
| 60 | return math_ops.cast(val, self._toDataType(dtype), name="cast").eval() |
| 61 | |
| 62 | def _test(self, x, dtype, use_gpu=False): |
| 63 | """Tests cast(x) to dtype behaves the same as numpy.astype.""" |
| 64 | np_ans = x.astype(dtype) |
| 65 | tf_ans = self._cast(x, dtype, use_gpu) |
| 66 | self.assertAllEqual(np_ans, tf_ans) |
| 67 | |
| 68 | def _testTypes(self, x, use_gpu=False): |
| 69 | """Tests cast(x) to different tf.""" |
no test coverage detected