docstr: Tests cast(x) to dtype behaves the same as numpy.astype.
code: def _test(self, x, dtype, use_gpu=False):
      """Tests cast(x) to dtype behaves the same as numpy.astype."""
      np_ans = x.astype(dtype)
      tf_ans = self._cast(x, dtype, use_gpu)
      self.assertAllEqual(np_ans, tf_ans)
  
imports: import numpy
  from tensorflow.python.eager import context
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import sparse_tensor
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import gen_state_ops
  from tensorflow.python.ops import gradient_checker_v2
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import variables
  from tensorflow.python.platform import test
label_desc: Use image node_id 3 for calling the CastOpTest obj's underlying member method code with example usage: obj._test(x, dtype, use_gpu) without return types