def validate_quant_params(args):
    """
    Ensures that the specified quantized parameters are valid
    """
    bit_range = [3, 4, 5, 6, 7, 8]

    if args.method == "target_bit_width":
        if args.bit_width is not None and args.bit_width not in bit_range:
            raise ValueError("Bit width must be one of 3, 4, 5, 6, 7, 8.")

    if args.bit_width_limits is not None:
        l_bit, u_bit = args.bit_width_limits
        if l_bit < 3:
            raise ValueError("Smallest bit width must be >= 3")

        if u_bit > 8:
            raise ValueError("Largest bit width must be <= 8")

    return args