def dequantize(x, scale_factor, num_levels=255):
    """
    Reverse operation of quantize_to_int

    Parameters:
    - x: np.array(dtype=int), quantized vector in integer representation
    - scale factor: float input will be mapped to this range
    - num_levels: int: number of quantization levels, must be odd
    
    Returns: np.array(dtype=float), in float representation
    """
    assert num_levels % 2

    x = x / ((num_levels - 1) / 2)
    x = x * scale_factor
    return x