parameters: (value, dtype, name=None)
docstring: 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 that values would over or underflow in the cast, this op
    applies the appropriate clamping before the cast.
  
    Args:
      value: A `Tensor`.
      dtype: The desired output `DType`.
      name: A name for the operation (optional).
  
    Returns:
      `value` safely cast to `dtype`.
docstring_summary: Performs a safe saturating cast of `value` to `dtype`.
docstring_tokens: Performs a safe saturating cast of value to dtype .
function: def saturate_cast(value, dtype, name=None):
    """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 that values would over or underflow in the cast, this op
    applies the appropriate clamping before the cast.
  
    Args:
      value: A `Tensor`.
      dtype: The desired output `DType`.
      name: A name for the operation (optional).
  
    Returns:
      `value` safely cast to `dtype`.
    """
    # When casting to a type with smaller representable range, clamp.
    # Note that this covers casting to unsigned types as well.
    with ops.name_scope(name, "saturate_cast", [value]) as name:
      value = ops.convert_to_tensor(value, name="value")
      dtype = dtypes.as_dtype(dtype).base_dtype
      if value.dtype.min < dtype.min:
        value = gen_math_ops.maximum(
            value,
            ops.convert_to_tensor(dtype.min, dtype=value.dtype, name="min"))
      if value.dtype.max > dtype.max:
        value = gen_math_ops.minimum(
            value,
            ops.convert_to_tensor(dtype.max, dtype=value.dtype, name="max"))
      return cast(value, dtype, name=name)
function_tokens: def saturate_cast ( value , dtype , name = None ) : # When casting to a type with smaller representable range, clamp. # Note that this covers casting to unsigned types as well. with ops . name_scope ( name , "saturate_cast" , [ value ] ) as name : value = ops . convert_to_tensor ( value , name = "value" ) dtype = dtypes . as_dtype ( dtype ) . base_dtype if value . dtype . min < dtype . min : value = gen_math_ops . maximum ( value , ops . convert_to_tensor ( dtype . min , dtype = value . dtype , name = "min" ) ) if value . dtype . max > dtype . max : value = gen_math_ops . minimum ( value , ops . convert_to_tensor ( dtype . max , dtype = value . dtype , name = "max" ) ) return cast ( value , dtype , name = name )