§
    Ÿ²Åj]  ã                   óü   — d dl Z d dlmZ d dlmZ d dlZg d¢Z G d„ dej        j        j	        ¦  «        Z	 ede
¬¦  «        d	„ ¦   «         Z ed
e
¬¦  «        dddœd„¦   «         Z ede
¬¦  «        d„ ¦   «         ZdS )é    N)ÚAny)Ú
deprecated)ÚautocastÚ
custom_fwdÚ
custom_bwdc                   óž   ‡ — e Zd ZdZ ede¬¦  «        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.cuda.amp.autocast(args...)`` is deprecated. Please use ``torch.amp.autocast("cuda", args...)`` instead.
    zk`torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.©ÚcategoryTÚenabledÚdtypeÚcache_enabledc                 ó¼   •— t           j                             ¦   «         r|| _        d| _        || _        d S t          ¦   «                              d|||¬¦  «         d S )NÚcuda)r   r   r   )ÚtorchÚ_jit_internalÚis_scriptingÚ_enabledÚdeviceÚ
fast_dtypeÚsuperÚ__init__)Úselfr   r   r   Ú	__class__s       €úMC:\Projects\Historical\venv\Lib\site-packages\torch/cuda/amp/autocast_mode.pyr   zautocast.__init__   sj   ø€ õ Ô×+Ò+Ñ-Ô-ð 	Ø#ˆDŒMØ ˆDŒKØ#ˆDŒOØˆFÝ‰Œ×ÒØ˜G¨5Àð 	ñ 	
ô 	
ð 	
ð 	
ð 	
ó    c                 ó„   •— t           j                             ¦   «         r| S t          ¦   «                              ¦   «         S ©N)r   r   r   r   Ú	__enter__)r   r   s    €r   r   zautocast.__enter__&   s5   ø€ ÝÔ×+Ò+Ñ-Ô-ð 	ØˆKÝ‰wŒw× Ò Ñ"Ô"Ð"r   Úexc_typeÚexc_valÚexc_tbc                 óŠ   •— t           j                             ¦   «         rd S t          ¦   «                              |||¦  «        S r   )r   r   r   r   Ú__exit__)r   r   r    r!   r   s       €r   r#   zautocast.__exit__,   s;   ø€ ÝÔ×+Ò+Ñ-Ô-ð 	ØˆFÝ‰wŒw×Ò ¨'°6Ñ:Ô:Ð:r   c                 ó†   •— t           j                             ¦   «         r|S t          ¦   «                              |¦  «        S r   )r   r   r   r   Ú__call__)r   Úfuncr   s     €r   r%   zautocast.__call__1   s7   ø€ ÝÔ×+Ò+Ñ-Ô-ð 	ØˆKÝ‰wŒw×Ò Ñ%Ô%Ð%r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   ÚFutureWarningr   Úfloat16Úboolr   r   r   r   r#   r%   Ú__classcell__)r   s   @r   r   r      s  ø€ € € € € ðð ð
 €Zð	Dàðñ ô ð Ø"œ]Ø"ð	
ð 
àð
ð Œ{ð
ð ð	
ð 
ð 
ð 
ð 
ñô ð

ð#ð #ð #ð #ð #ð; ð ;¨sð ;¸Cð ;ð ;ð ;ð ;ð ;ð ;ð
&ð &ð &ð &ð &ð &ð &ð &ð &r   r   z‹`torch.cuda.amp.autocast_mode._cast(value, dtype)` is deprecated. Please use `torch.amp.autocast_mode._cast(value, 'cuda', dtype)` instead.r	   c                 óN   — t           j        j                             | d|¦  «        S )Nr   )r   ÚampÚautocast_modeÚ_cast)Úvaluer   s     r   r2   r2   8   s!   € õ Œ9Ô"×(Ò(¨°¸Ñ>Ô>Ð>r   z{`torch.cuda.amp.custom_fwd(args...)` is deprecated. Please use `torch.amp.custom_fwd(args..., device_type='cuda')` instead.)Úcast_inputsc                ób   —  t          j        t          j        j        d¬¦  «        | |¬¦  «        S )z�
    ``torch.cuda.amp.custom_fwd(args...)`` is deprecated. Please use
    ``torch.amp.custom_fwd(args..., device_type='cuda')`` instead.
    r   ©Údevice_type©Úfwdr4   )Ú	functoolsÚpartialr   r0   r   r8   s     r   r   r   A   s8   € ð G�9Ô�UœYÔ1¸vÐFÑFÔFØ˜[ðñ ô ð r   z{`torch.cuda.amp.custom_bwd(args...)` is deprecated. Please use `torch.amp.custom_bwd(args..., device_type='cuda')` instead.c                 ó^   —  t          j        t          j        j        d¬¦  «        | ¦  «        S )z�
    ``torch.cuda.amp.custom_bwd(args...)`` is deprecated. Please use
    ``torch.amp.custom_bwd(args..., device_type='cuda')`` instead.
    r   r6   )r:   r;   r   r0   r   )Úbwds    r   r   r   P   s*   € ð G�9Ô�UœYÔ1¸vÐFÑFÔFÀsÑKÔKÐKr   r   )r:   Útypingr   Útyping_extensionsr   r   Ú__all__r0   r1   r   r+   r2   r   r   © r   r   ú<module>rB      sF  ðà Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø (Ð (Ð (Ð (Ð (Ð (à €€€ð 3Ð
2Ð
2€ð(&ð (&ð (&ð (&ð (&ˆuŒyÔ&Ô/ñ (&ô (&ð (&ðX €ðPàðñ ô ð
?ð ?ñô ð
?ð €ðNàðñ ô ð
¨ð ð ð ð ñô ð
ð €ðNàðñ ô ð
Lð Lñô ð
Lð Lð Lr   