docs: def _scale_tensor(tensor, range_min, range_max, scale_min, scale_max):
    """Scale a tensor to scale_min to scale_max.
  
    Args:
      tensor: input tensor. Should be a numerical tensor.
      range_min: min expected value for this feature/tensor.
      range_max: max expected Value.
      scale_min: new expected min value.
      scale_max: new expected max value.
  
    Returns:
      scaled tensor.
    """
    if range_min == range_max:
      return tensor
  
    float_tensor = tf.to_float(tensor)
    scaled_tensor = tf.divide((tf.subtract(float_tensor, range_min) *
                               tf.constant(float(scale_max - scale_min))),
                              tf.constant(float(range_max - range_min)))
    shifted_tensor = scaled_tensor + tf.constant(float(scale_min))
  
    return shifted_tensor