U
    ‰dõ  ã                   @   s(   d dl Z d dlZ G dd„ de jjƒZdS )é    Nc                   @   s8   e Zd ZdZdd„ Zdd„ Zedd„ ƒZedd	„ ƒZd
S )ÚDropouta`  This is the quantized equivalent of :class:`~torch.nn.Dropout`.
        And this is a placeholder to enable models where fp32 tensors
        had dropout to work with quantized tensors in train and eval mode.

    Args:
        p: probability of an element to be zeroed
        inplace: can optionally do the operation in-place. Default: ``False``
    c                 C   s   |S ©N© )ÚselfÚinputr   r   úF/tmp/pip-unpacked-wheel-ua33x9lu/torch/nn/quantized/modules/dropout.pyÚforward   s    zDropout.forwardc                 C   s   dS )NZQuantizedDropoutr   )r   r   r   r   Ú	_get_name   s    zDropout._get_namec                 C   s   | |j |jƒS r   ©ÚpZinplace)ÚclsÚmodr   r   r   Ú
from_float   s    zDropout.from_floatc                 C   s   | |j |jƒS r   r
   )r   r   ZscaleZ
zero_pointr   r   r   Úfrom_reference   s    zDropout.from_referenceN)	Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r	   Úclassmethodr   r   r   r   r   r   r      s   	
r   )ZtorchZtorch.nn.quantized.functionalÚnnr   r   r   r   r   Ú<module>   s   