MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / _test

Method _test

tensorflow/python/kernel_tests/cast_op_test.py:62–66  ·  view source on GitHub ↗

Tests cast(x) to dtype behaves the same as numpy.astype.

(self, x, dtype, use_gpu=False)

Source from the content-addressed store, hash-verified

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."""

Callers 1

_testTypesMethod · 0.95

Calls 2

_castMethod · 0.95
assertAllEqualMethod · 0.45

Tested by

no test coverage detected