§
    Ÿ²Åj<  ã                   ó„   — d dl mZ  G d„ dej        ¦  «        Z G d„ dej        ¦  «        Z G d„ dej        ¦  «        ZdS )	é    )Únnc                   ó*   ‡ — e Zd ZdZdˆ fd„	Zd„ Zˆ xZS )Ú	QuantStuba  Quantize stub module, before calibration, this is same as an observer,
    it will be swapped as `nnq.Quantize` in `convert`.

    Args:
        qconfig: quantization configuration for the tensor,
            if qconfig is not provided, we will get qconfig from parent modules
    Nc                 ó^   •— t          ¦   «                              ¦   «          |r	|| _        d S d S ©N©ÚsuperÚ__init__Úqconfig©Úselfr   Ú	__class__s     €úLC:\Projects\Historical\venv\Lib\site-packages\torch/ao/quantization/stubs.pyr
   zQuantStub.__init__   ó6   ø€ Ý‰Œ×ÒÑÔÐØð 	#Ø"ˆDŒLˆLˆLð	#ð 	#ó    c                 ó   — |S r   © ©r   Úxs     r   ÚforwardzQuantStub.forward   ó   € Øˆr   r   ©Ú__name__Ú
__module__Ú__qualname__Ú__doc__r
   r   Ú__classcell__©r   s   @r   r   r      óV   ø€ € € € € ðð ð#ð #ð #ð #ð #ð #ð
ð ð ð ð ð ð r   r   c                   ó*   ‡ — e Zd ZdZdˆ fd„	Zd„ Zˆ xZS )ÚDeQuantStuba  Dequantize stub module, before calibration, this is same as identity,
    this will be swapped as `nnq.DeQuantize` in `convert`.

    Args:
        qconfig: quantization configuration for the tensor,
            if qconfig is not provided, we will get qconfig from parent modules
    Nc                 ó^   •— t          ¦   «                              ¦   «          |r	|| _        d S d S r   r   r   s     €r   r
   zDeQuantStub.__init__!   r   r   c                 ó   — |S r   r   r   s     r   r   zDeQuantStub.forward&   r   r   r   r   r   s   @r   r!   r!      r   r   r!   c                   óR   ‡ — e Zd ZU dZeed<   eed<   ej        ed<   ˆ fd„Z	d„ Z
ˆ xZS )ÚQuantWrapperaç  A wrapper class that wraps the input module, adds QuantStub and
    DeQuantStub and surround the call to module with call to quant and dequant
    modules.

    This is used by the `quantization` utility functions to add the quant and
    dequant modules, before `convert` function `QuantStub` will just be observer,
    it observes the input tensor, after `convert`, `QuantStub`
    will be swapped to `nnq.Quantize` which does actual quantization. Similarly
    for `DeQuantStub`.
    ÚquantÚdequantÚmodulec                 óV  •— t          ¦   «                              ¦   «          t          |dd ¦  «        }|                      dt	          |¦  «        ¦  «         |                      dt          |¦  «        ¦  «         |                      d|¦  «         |                      |j        ¦  «         d S )Nr   r&   r'   r(   )r	   r
   ÚgetattrÚ
add_moduler   r!   ÚtrainÚtraining)r   r(   r   r   s      €r   r
   zQuantWrapper.__init__9   s�   ø€ Ý‰Œ×ÒÑÔÐÝ˜& )¨TÑ2Ô2ˆØ�Š˜¥¨7Ñ!3Ô!3Ñ4Ô4Ð4Ø�Š˜	¥;¨wÑ#7Ô#7Ñ8Ô8Ð8Ø�Š˜ &Ñ)Ô)Ð)Ø�
Š
�6”?Ñ#Ô#Ð#Ð#Ð#r   c                 ó€   — |                       |¦  «        }|                      |¦  «        }|                      |¦  «        S r   )r&   r(   r'   )r   ÚXs     r   r   zQuantWrapper.forwardA   s0   € Ø�JŠJ�q‰MŒMˆØ�KŠK˜‰NŒNˆØ�|Š|˜A‰ŒÐr   )r   r   r   r   r   Ú__annotations__r!   r   ÚModuler
   r   r   r   s   @r   r%   r%   *   s{   ø€ € € € € € ð	ð 	ð ÐÐÑØÐÐÑØŒIÐÐÑð$ð $ð $ð $ð $ðð ð ð ð ð ð r   r%   N)Útorchr   r1   r   r!   r%   r   r   r   ú<module>r3      s§   ðð Ð Ð Ð Ð Ð ðð ð ð ð �”	ñ ô ð ð$ð ð ð ð �"”)ñ ô ð ð$ð ð ð ð �2”9ñ ô ð ð ð r   