def get_quant_range(n_bits: int, dtype: _torch.dtype) -> _Tuple[int, int]:
    """
    Returns quant_max and quant_min values for a given quantization n_bits.
    """
    max_q = 2**n_bits
    if dtype in [_torch.quint8, _torch.uint8]:
        quant_min = 0
        quant_max = max_q - 1
    else:
        quant_min = -max_q / 2
        quant_max = max_q / 2 - 1
    return int(quant_min), int(quant_max)

    Returns quant_max and quant_min values for a given quantization n_bits.
    
coremltools/optimize/torch/quantization/_utils.py