def vitis_quantize(f_tensor, pos, bit_width=8):
    """
    Quantize the tensor using the corresponding fixed-point position.
    """
    scale, lower_bound, upper_bound = get_bound_and_scale(pos)
    q_tensor = np.round(f_tensor / scale) * scale
    q_tensor = lower_bound * (q_tensor < lower_bound) + q_tensor * (q_tensor >= lower_bound)
    q_tensor = upper_bound * (q_tensor > upper_bound) + q_tensor * (q_tensor <= upper_bound)
    return q_tensor

    Quantize the tensor using the corresponding fixed-point position.
    
olive/passes/onnx/vitis_ai/quant_utils.py