U
    Kºc‡  ã                   @   s$   d dl Z G dd„ de jjjjƒZdS )é    Nc                       s(   e Zd ZdZdddœ‡ fdd„Z‡  ZS )ÚLinearah  
    A linear module attached with FakeQuantize modules for weight,
    used for dynamic quantization aware training.

    We adopt the same interface as `torch.nn.Linear`, please see
    https://pytorch.org/docs/stable/nn.html#torch.nn.Linear
    for documentation.

    Similar to `torch.nn.Linear`, with FakeQuantize modules initialized to
    default.
    TN)Úreturnc                    s0   t ƒ  ||||||¡ tjj |¡s,tdƒ‚d S )NzqDynamic QAT requires a memoryless observer.This means a MovingAverage observer with averaging constant equal to 1)ÚsuperÚ__init__ÚtorchÚaoZquantizationZactivation_is_memorylessÚ
ValueError)ÚselfZin_featuresZout_featuresZbiasZqconfigZdeviceZdtype©Ú	__class__© úJ/tmp/pip-unpacked-wheel-gikjz4vx/torch/ao/nn/qat/dynamic/modules/linear.pyr      s
    ÿzLinear.__init__)TNNN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Ú__classcell__r   r   r
   r   r      s         ÿÿr   )r   r   ÚnnZqatr   r   r   r   r   Ú<module>   s   