U
    Kºcç  ã                   @   s&   d dl Z dgZG dd„ de jjƒZdS )é    NÚDropoutc                   @   s8   e Zd ZdZdd„ Zdd„ Zedd„ ƒZedd	„ ƒZd
S )r   a`  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   úI/tmp/pip-unpacked-wheel-gikjz4vx/torch/ao/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   	
)ZtorchÚ__all__Únnr   r   r   r   r   Ú<module>   s   