def _unscale_unit(unit, scale):
    """Shifts and scales the unit.

    Args:
        unit: np.array with shape [dims].
        scale: scale of the unit.

    Returns:
        scaled unit as np.array with shape [dims].
    """
    return (unit + 1) / 2 * scale
