
    Ph
                     p    d dl mZ d dlZdgZ G d dej                  j
                  j                        Zy)    )AnyNautocastc                        e Zd ZdZdej
                  dfdedej                  def fdZ fdZ	de
d	e
d
e
f fdZ fdZ xZS )r   z
    See :class:`torch.autocast`.
    ``torch.cpu.amp.autocast(args...)`` is equivalent to ``torch.autocast("cpu", args...)``
    Tenableddtypecache_enabledc                     t         j                  j                         r|| _        d| _        || _        y t        |   d|||       y )Ncpu)r   r   r   )torch_jit_internalis_scripting_enableddevice
fast_dtypesuper__init__)selfr   r   r   	__class__s       fC:\Users\daisl\Desktop\realtime-object-detection\venv\Lib\site-packages\torch/cpu/amp/autocast_mode.pyr   zautocast.__init__   sJ     ++-#DMDK#DO7%} 	 	
    c                 `    t         j                  j                         r| S t        |          S N)r   r   r   r   	__enter__)r   r   s    r   r   zautocast.__enter__   s(    ++-Kw ""r   exc_typeexc_valexc_tbc                 d    t         j                  j                         ry t        |   |||      S r   )r   r   r   r   __exit__)r   r   r   r   r   s       r   r   zautocast.__exit__#   s,    ++-w'6::r   c                 b    t         j                  j                         r|S t        |   |      S r   )r   r   r   r   __call__)r   funcr   s     r   r    zautocast.__call__(   s*    ++-Kw%%r   )__name__
__module____qualname____doc__r   bfloat16boolr   r   r   r   r   r    __classcell__)r   s   @r   r   r      se     "^^"	

 {{
 	
#; ;s ;C ;
& &r   )typingr   r   __all__ampautocast_moder    r   r   <module>r.      s.     ,#&uyy&&// #&r   