tf.saturate_cast

tf.saturate_cast

tf.saturate_cast

saturate_cast(
    value,
    dtype,
    name=None
)

Defined in tensorflow/python/ops/math_ops.py.

See the guide: Tensor Transformations > Casting

Performs a safe saturating cast of value to dtype.

This function casts the input to dtype without applying any scaling. If there is a danger