tf.dtypes.saturate_cast

Performs a safe saturating cast of value to dtype.

Used in the notebooks

Used in the tutorials

This function casts the input to dtype without overflow. If there is a danger that values would over or underflow in the cast, this op applies the appropriate clamping before the cast. See tf.cast for more details.

value A Tensor.
dtype The desired output DType.
name A name for the operation (optional).

value safely cast to dtype.