§
    v-jñ  ã                  ó®   — d dl mZ d dlmZ d dlmZmZ ddlmZm	Z	m
Z
 ddlmZmZ ddlmZmZmZmZmZmZmZ ddl
mZmZmZ g d	¢ZeZeZddd„Zddd„Zd
S )é    )Úannotations)Úcore)Ú_current_expected_placeÚ_get_paddle_placeé   )Úaccuracy_compareÚ	debuggingÚgrad_scaler)Ú
black_listÚ
white_list)Úamp_decorateÚ	amp_guardÚ	auto_castÚautocastÚdecorateÚget_autocast_dtypeÚis_autocast_enabled)Ú	AmpScalerÚ
GradScalerÚOptimizerState)	r   r   r   Úis_float16_supportedÚis_bfloat16_supportedr   r   Úget_autocast_cpu_dtypeÚget_autocast_gpu_dtypeNÚdeviceú
str | NoneÚreturnÚboolc                óh   — | €t          ¦   «         nt          | ¦  «        } t          j        | ¦  «        S )a  
    Determine whether the place supports float16 in the auto-mixed-precision training.

    Args:
        device (str|None, optional): Specify the running device.
            It can be ``cpu``, ``gpu``, ``xpu``, ``gpu:x`` and ``xpu:x``,
            where ``x`` is the index of the GPUs or XPUs. if device is None, the device is the current device. Default: None.

    Examples:

        .. code-block:: python

            >>> import paddle
            >>> paddle.amp.is_float16_supported() # True or False
            False
    )r   r   r   r   ©r   s    úS/var/www/html/banglarbhumi/venv/lib/python3.11/site-packages/paddle/amp/__init__.pyr   r   >   s:   € ð( ˆ>õ 	 Ñ!Ô!Ð!å˜vÑ&Ô&ð õ Ô$ VÑ,Ô,Ð,ó    c                óh   — | €t          ¦   «         nt          | ¦  «        } t          j        | ¦  «        S )a  
    Determine whether the place supports bfloat16 in the auto-mixed-precision training.

    Args:
        device (str|None, optional): Specify the running device.
            It can be ``cpu``, ``gpu``, ``xpu``, ``gpu:x`` and ``xpu:x``,
            where ``x`` is the index of the GPUs or XPUs. if device is None, the device is the current device. Default: None.

    Examples:

        .. code-block:: python

            >>> import paddle
            >>> paddle.amp.is_bfloat16_supported() # True or False
            True
    )r   r   r   r   r    s    r!   r   r   Y   s:   € ð( ˆ>õ 	 Ñ!Ô!Ð!å˜vÑ&Ô&ð õ Ô% fÑ-Ô-Ð-r"   )N)r   r   r   r   )Ú
__future__r   Úpaddle.baser   Úpaddle.base.frameworkr   r   Ú r   r	   r
   Ú	amp_listsr   r   r   r   r   r   r   r   r   r   r   r   Ú__all__r   r   r   r   © r"   r!   ú<module>r+      s”  ðð #Ð "Ð "Ð "Ð "Ð "à Ð Ð Ð Ð Ð ðð ð ð ð ð ð ð ð
ð ð ð ð ð ð ð ð ð ð
ð ð ð ð ð ð ð ðð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ðð ð ð ð ð ð ð ð ð ð
ð 
ð 
€ð ,Ð Ø+Ð ð-ð -ð -ð -ð -ð6.ð .ð .ð .ð .ð .ð .r"   