o
    ûpi…  ã                   @   s@   d dl Z ddlmZmZmZmZ G dd„ dƒZeeƒ eƒ ƒZdS )é    Né   )ÚSUPPORT_ACT_QUANTIZERSÚSUPPORT_WT_QUANTIZERSÚKLQuantizerÚPerChannelAbsmaxQuantizerc                       s    e Zd ZdZ‡ fdd„Z‡  ZS )Ú	PTQConfigzF
    The PTQ config shows how to quantize the inputs and outputs.
    c                    sb   t ƒ  ¡  t|ttƒƒsJ ‚t|ttƒƒsJ ‚t |¡| _t |¡| _	t |¡| _
d| _d| _dS )a3  
        Constructor.

        Args:
            activation_quantizer(BaseQuantizer): The activation quantizer.
                It should be the instance of BaseQuantizer.
            weight_quantizer(BaseQuantizer): The weight quantizer.
                It should be the instance of BaseQuantizer.
        NF)ÚsuperÚ__init__Ú
isinstanceÚtupler   r   ÚcopyÚdeepcopyZin_act_quantizerZout_act_quantizerZwt_quantizerZquant_hook_handleZenable_in_act_quantizer)ÚselfZactivation_quantizerZweight_quantizer©Ú	__class__© úp/home/app/PaddleOCR-VL/.venv_paddleocr/lib/python3.10/site-packages/paddle/quantization/imperative/ptq_config.pyr	      s   


zPTQConfig.__init__)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r	   Ú__classcell__r   r   r   r   r      s    r   )r   Zptq_quantizerr   r   r   r   r   Zdefault_ptq_configr   r   r   r   Ú<module>   s   