code: def testConst(self):
      types = {
          dtypes.bool,
          dtypes.int8,
          dtypes.int16,
          dtypes.int32,
          dtypes.int64,
          dtypes.uint8,
          dtypes.uint16,
          dtypes.uint32,
          dtypes.uint64,
          dtypes.float16,
          dtypes.bfloat16,
          dtypes.float32,
          dtypes.float64,
          dtypes.float8_e5m2,
          dtypes.float8_e4m3fn,
      }
      for dtype in types:
          with self.subTest(dtype=dtype):
              if dtype == dtypes.bool:
                  values = [True, False]
              else:
                  values = [0.0, 1.0, -1.0, dtype.min, dtype.max]
              if dtype.is_floating:
                  values.extend(
                      [float("Inf"), -float("Inf"), float("NaN")]
                  )
              values = np.array(values, dtype=dtype.as_numpy_dtype)
  
              @def_function.function(jit_compile=True)
              def f():
                  return constant_op.constant(
                      values, dtype
                  )  # pylint: disable=cell-var-from-loop
  
              result = f()
              self.assertAllEqual(self.evaluate(result), values)
  
file_path: tensorflow/tensorflow/compiler/tests/const_test.py
imports: import numpy
  from tensorflow.python.eager import def_function
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import test_util
  from tensorflow.python.platform import test
label_desc: Use image node_id 1 for calling the ConstOpTest obj's underlying member method code with example usage: obj.testConst() and returns: constant_op