def quantize_onnx_model(
    onnx_model_path: Union[Path, str],
    quantized_model_path: Union[Path, str],
    qtype: str = "qint8",
    verbose: bool = False,
) -> None:
    """Takes model converted to onnx runtime and applies pruning.

    Args:
        onnx_model_path: path to onnx model.
        quantized_model_path: path to quantized model.
        qtype: Type of weights in quantized model.
            Can be `quint8` or `qint8`. Defaults to "qint8".
        verbose: If set to True prints model size before
            and after quantization. Defaults to False.

    Raises:
        ValueError: If qtype is not understood.
    """
    type_mapping = {
        "qint8": QuantType.QInt8,
        "quint8": QuantType.QUInt8,
    }
    if qtype not in type_mapping.keys():
        raise ValueError(
            "type should be string one of 'quint8' or 'qint8'. Got {}".format(qtype)
        )
    quantize_dynamic(
        onnx_model_path, quantized_model_path, weight_type=type_mapping[qtype]
    )
    if verbose:
        v_str = (
            "Model size before quantization (MB):"
            f"{os.path.getsize(onnx_model_path) / 2**20:.2f}\n"
            "Model size after quantization (MB):"
            f"{os.path.getsize(quantized_model_path) / 2**20:.2f}"
        )
        print("Done.")
        print(v_str)
        print(f"Quantized model saved to {quantized_model_path}.")
Takes model converted to onnx runtime and applies pruning.

    Args:
        onnx_model_path: path to onnx model.
        quantized_model_path: path to quantized model.
        qtype: Type of weights in quantized model.
            Can be `quint8` or `qint8`. Defaults to "qint8".
        verbose: If set to True prints model size before
            and after quantization. Defaults to False.

    Raises:
        ValueError: If qtype is not understood.
    
catalyst/utils/onnx.py