U
    yh$                     @   s&   d dl Z dgZG dd de jjZdS )    NDropoutc                   @   s:   e Zd ZdZdd Zdd Zed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   W/var/www/html/venv/lib/python3.8/site-packages/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_nameFc                 C   s   | |j |jS r   pZinplace)clsmodZuse_precomputed_fake_quantr   r   r   
from_float   s    zDropout.from_floatc                 C   s   | |j |jS r   r
   )r   r   scaleZ
zero_pointr   r   r   from_reference   s    zDropout.from_referenceN)F)	__name__
__module____qualname____doc__r   r	   classmethodr   r   r   r   r   r   r      s   	)Ztorch__all__nnr   r   r   r   r   <module>   s   