code: def testSaturate(self):
      in_types = (dtypes.float32,)
      out_types = (
          dtypes.int8,
          dtypes.uint8,
          dtypes.int16,
          dtypes.float32,
      )
      for in_type in in_types:
          for out_type in out_types:
              lo, hi = in_type.min, in_type.max
              x = constant_op.constant(
                  [lo, lo + 1, lo // 2, hi // 2, hi - 1, hi],
                  dtype=in_type,
              )
              y = math_ops.saturate_cast(x, dtype=out_type)
              self.assertEqual(y.dtype, out_type)
              x, y = self.evaluate([x, y])
              correct = np.maximum(
                  out_type.min, np.minimum(out_type.max, x)
              )
              self.assertAllEqual(correct, y)
  
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 1 for calling the SaturateCastTest obj's underlying member method code with example usage: obj.testSaturate() without return types