code: def testFloat8(self):
      a = np.random.uniform(-100, 100, 100).astype(np.float32)
      for float8 in (dtypes.float8_e4m3fn, dtypes.float8_e5m2):
          # Including float8_e4m3fn should cover the float8 combinations without
          # loss of precision.
          for dtype in (
              dtypes.float64,
              dtypes.float32,
              dtypes.bfloat16,
              dtypes.float16,
              dtypes.float8_e4m3fn,
          ):
              with self.cached_session(use_gpu=True):
                  b = ops.convert_to_tensor(a, float8)
                  c = math_ops.cast(math_ops.cast(b, dtype), float8)
                  self.assertAllEqual(b, c)
  
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 9 for calling the CastOpTest obj's underlying member method code with example usage: obj.testFloat8() without return types