§
    Ì²Åj0C  ã                   óR  — U d Z ddlZddlZddlmZ ddlmZmZmZm	Z	m
Z
mZmZ ddlZddlZddlmZ ddlmZmZ ddlmZ dd	lmZmZ d
a ej        ¦   «         Z ej        ¦   «         Zg ae	eeg df         e	e         f                  e d<    e!ej"        dd„ ¦  «        Z#eeee$df         Z% e¦   «         a&dZ'eej"        j(                 e d<   de)fd„Z* e*¦   «         r%ej"        j+        Z+ej"        j,        Z-ej"        j.        Z/n ed¦  «        Z+de$de$fd„Z-de$de$fd„Z/ ed¬¦  «        de$fd„¦   «         Z0de)fd„Z1d„ Z2d„ Z3d„ Z4d„ Z5d„ Z6 G d„ d¦  «        Z7 G d „ d¦  «        Z G d!„ d"e¦  «        Z8de%ddfd#„Z9d<de
e%         defd$„Z: ed¦  «        d<de
e%         deeef         fd%„¦   «         Z;d<de
e%         de+fd&„Z<de$fd'„Z=dee$eej        f         dej        fd(„Z> G d)„ d*¦  «        Z?d+e
d,         de?fd-„Z@d.„ ZAd+efd/„ZBd<de
e%         defd0„ZCd<de%ddfd1„ZDde	e         fd2„ZEdefd3„ZFdej        dej"        j(        fd4„ZG	 d=d6e$dee$eej        f         ddfd7„ZHd=dee$eej        f         de$fd8„ZIdd9lJmKZKmLZLmMZMmNZNmOZOmPZPmQZQmRZRmSZSmTZT dd:lUmVZVmWZWmXZXmYZYmZZZm[Z[m\Z\m]Z]m^Z^ g d;¢Z_dS )>zó
This package introduces support for the XPU backend, specifically tailored for
Intel GPU optimization.

This package is lazily initialized, so you can always import it, and use
:func:`is_available()` to determine if your system supports XPU.
é    N)Ú	lru_cache)ÚAnyÚCallableÚDictÚListÚOptionalÚTupleÚUnion©Údevice)Ú_dummy_typeÚ_LazySeedTrackeré   )Ú_get_device_index)ÚEventÚStreamFÚ_queued_callsÚ_xpu_isInBadForkc                  ó   — dS ©NF© r   ó    úCC:\Projects\Historical\venv\Lib\site-packages\torch/xpu/__init__.pyú<lambda>r      s   € À€ r   r   Údefault_generatorsÚreturnc                  ó$   — t           j        j        S )z(Return true if compile with XPU support.)ÚtorchÚ_CÚ_has_xpur   r   r   Ú_is_compiledr!   #   s   € åŒ8ÔÐr   Ú_XpuDevicePropertiesr   c                 ó    — t          d¦  «        ‚©Nz(PyTorch was compiled without XPU support©ÚNotImplementedErrorr   s    r   Ú_exchange_devicer'   0   ó   € Ý!Ð"LÑMÔMÐMr   c                 ó    — t          d¦  «        ‚r$   r%   r   s    r   Ú_maybe_exchange_devicer*   3   r(   r   )Úmaxsizec                  ó^   — t          ¦   «         sdS t          j                             ¦   «         S )z*Return the number of XPU device available.r   )r!   r   r   Ú_xpu_getDeviceCountr   r   r   Údevice_countr.   7   s)   € õ ‰>Œ>ð ØˆqÝŒ8×'Ò'Ñ)Ô)Ð)r   c                  ó&   — t          ¦   «         dk    S )z7Return a bool indicating if XPU is currently available.r   )r.   r   r   r   Úis_availabler0   ?   s   € õ ‰>Œ>˜AÒÐr   c                  ó   — dS )zKReturn a bool indicating if the current XPU device supports dtype bfloat16.Tr   r   r   r   Úis_bf16_supportedr2   E   s   € àˆ4r   c                  ó.   — t           ot          ¦   «          S )z8Return whether PyTorch's XPU state has been initialized.)Ú_initializedÚ_is_in_bad_forkr   r   r   Úis_initializedr6   J   s   € åÐ1¥Ñ 1Ô 1Ð1Ð1r   c                 ó¤  — t          ¦   «         r | ¦   «          d S |                     dd¦  «        r.t                               | t	          j        ¦   «         ¦  «         d S |                     dd¦  «        r.t                               | t	          j        ¦   «         ¦  «         d S t                               | t	          j        ¦   «         f¦  «         d S )NÚseed_allFÚseed)	r6   ÚgetÚ_lazy_seed_trackerÚqueue_seed_allÚ	tracebackÚformat_stackÚ
queue_seedr   Úappend)ÚcallableÚkwargss     r   Ú
_lazy_callrC   O   sÄ   € ÝÑÔð 
GØˆ‰
Œ
ˆ
ˆ
ˆ
ð �:Š:�j %Ñ(Ô(ð 	GÝ×-Ò-¨h½	Ô8NÑ8PÔ8PÑQÔQÐQÐQÐQØ�ZŠZ˜ Ñ&Ô&ð 	GÝ×)Ò)¨(µIÔ4JÑ4LÔ4LÑMÔMÐMÐMÐMõ × Ò  (­IÔ,BÑ,DÔ,DÐ!EÑFÔFÐFÐFÐFr   c                  ó"   — t          ¦   «          dS )z×Initialize PyTorch's XPU state.
    This is a Python API about lazy initialization that avoids initializing
    XPU until the first time it is accessed. Does nothing if the XPU state is
    already initialized.
    N)Ú
_lazy_initr   r   r   ÚinitrF   ]   s   € õ �L„L€L€L€Lr   c            	      ó2  — t          ¦   «         st          t          d¦  «        rd S t          5  t          ¦   «         r	 d d d ¦  «         d S t	          ¦   «         rt          d¦  «        ‚t          ¦   «         st          d¦  «        ‚t          j	         
                    ¦   «          dt          _        t                               d„ t                               ¦   «         D ¦   «         ¦  «         	 t          D ]Z\  } }	  | ¦   «          Œ# t           $ r=}dt#          |¦  «        › dd                     |¦  «        › �}t!          |¦  «        |‚d }~ww xY w	 t'          t          d¦  «         n# t'          t          d¦  «         w xY wdad d d ¦  «         d S # 1 swxY w Y   d S )	NÚis_initializingzuCannot re-initialize XPU in forked subprocess. To use XPU with multiprocessing, you must use the 'spawn' start methodz#Torch not compiled with XPU enabledTc              3   ó   K  — | ]}|¯|V — Œ	d S ©Nr   )Ú.0Úcallss     r   ú	<genexpr>z_lazy_init.<locals>.<genexpr>}   s(   è è € ÐXÐX uÐRWÐX˜UÐXÐXÐXÐXÐXÐXr   z5XPU call failed lazily at initialization with error: z'

XPU call was originally invoked at:

Ú )r6   ÚhasattrÚ_tlsÚ_initialization_lockr5   ÚRuntimeErrorr!   ÚAssertionErrorr   r   Ú	_xpu_initrH   r   Úextendr;   Ú	get_callsÚ	ExceptionÚstrÚjoinÚdelattrr4   )Úqueued_callÚorig_tracebackÚeÚmsgs       r   rE   rE   f   s0  € åÑÔð �7¥4Ð):Ñ;Ô;ð ØˆÝ	ð !ð !õ ÑÔð 	Øð	!ð !ð !ñ !ô !ð !ð !ð !õ ÑÔð 	ÝðIñô ð õ ‰~Œ~ð 	HÝ Ð!FÑGÔGÐGåŒ×ÒÑÔÐð  $�Ôå×ÒÐXÐXÕ0B×0LÒ0LÑ0NÔ0NÐXÑXÔXÑXÔXÐXð	-Ý/<ð 0ð 0Ñ+�˜^ð0Ø�K‘M”M�M�MøÝ ð 0ð 0ð 0ð\ÕPSÐTUÑPVÔPVð \ð \ØBDÇ'Â'È.ÑBYÔBYð\ð \ð õ $ C™.œ.¨aÐ/øøøøð0øøøð0õ •DÐ+Ñ,Ô,Ð,Ð,ø�G•DÐ+Ñ,Ô,Ð,Ð,øøøØˆðC!ð !ð !ñ !ô !ð !ð !ð !ð !ð !ð !ð !øøøð !ð !ð !ð !ð !ð !sT   ­FÁ
BFÃ*E#Ã7
DÄE#Ä
E	Ä8EÅE	Å	E#ÅFÅ#E:Å:FÆFÆFc                   ó4   — e Zd Zdefd„Zd„ Zdededefd„ZdS )	Ú_DeviceGuardÚindexc                 ó"   — || _         d| _        d S ©Néÿÿÿÿ)ÚidxÚprev_idx)Úselfra   s     r   Ú__init__z_DeviceGuard.__init__�   s   € ØˆŒØˆŒˆˆr   c                 óX   — t           j                             | j        ¦  «        | _        d S rJ   ©r   Úxpur'   re   rf   ©rg   s    r   Ú	__enter__z_DeviceGuard.__enter__“   ó   € Ýœ	×2Ò2°4´8Ñ<Ô<ˆŒˆˆr   ÚtypeÚvaluer=   c                 óX   — t           j                             | j        ¦  «        | _        dS r   ©r   rk   r*   rf   re   ©rg   ro   rp   r=   s       r   Ú__exit__z_DeviceGuard.__exit__–   ó    € Ý”9×3Ò3°D´MÑBÔBˆŒØˆur   N)Ú__name__Ú
__module__Ú__qualname__Úintrh   rm   r   rt   r   r   r   r`   r`   Ž   sg   € € € € € ð˜cð ð ð ð ð=ð =ð =ð˜Sð ¨ð ¸ð ð ð ð ð ð r   r`   c                   ó8   — e Zd ZdZd efd„Zd„ Zdededefd„ZdS )	r   zÓContext-manager that changes the selected device.

    Args:
        device (torch.device or int or str): device index to select. It's a no-op if
            this argument is a negative integer or ``None``.
    c                 ó@   — t          |d¬¦  «        | _        d| _        d S )NT©Úoptionalrd   )r   re   rf   )rg   r   s     r   rh   zdevice.__init__£   s!   € Ý$ V°dÐ;Ñ;Ô;ˆŒØˆŒˆˆr   c                 óX   — t           j                             | j        ¦  «        | _        d S rJ   rj   rl   s    r   rm   zdevice.__enter__§   rn   r   ro   rp   r=   c                 óX   — t           j                             | j        ¦  «        | _        dS r   rr   rs   s       r   rt   zdevice.__exit__ª   ru   r   N)rv   rw   rx   Ú__doc__r   rh   rm   rt   r   r   r   r   r   ›   sq   € € € € € ðð ð˜sð ð ð ð ð=ð =ð =ð˜Sð ¨ð ¸ð ð ð ð ð ð r   c                   ó"   ‡ — e Zd ZdZˆ fd„Zˆ xZS )Ú	device_ofa  Context-manager that changes the current device to that of given object.

    You can use both tensors and storages as arguments. If a given object is
    not allocated on a XPU, this is a no-op.

    Args:
        obj (Tensor or Storage): object allocated on the selected device.
    c                 ó„   •— |j         r|                     ¦   «         nd}t          ¦   «                              |¦  «         d S rc   )Úis_xpuÚ
get_deviceÚsuperrh   )rg   Úobjre   Ú	__class__s      €r   rh   zdevice_of.__init__¹   s<   ø€ Ø"%¤*Ð4ˆc�nŠnÑÔÐ°"ˆÝ‰Œ×Ò˜ÑÔÐÐÐr   )rv   rw   rx   r€   rh   Ú__classcell__)rˆ   s   @r   r‚   r‚   ¯   sB   ø€ € € € € ðð ðð ð ð ð ð ð ð ð r   r‚   c                 óŽ   — t          ¦   «          t          | ¦  «        } | dk    r!t          j                             | ¦  «         dS dS )z¨Set the current device.

    Args:
        device (torch.device or int or str): selected device. This function is a
            no-op if this argument is negative.
    r   N)rE   r   r   r   Ú_xpu_setDevicer   s    r   Ú
set_devicerŒ   ¾   sF   € õ �L„L€LÝ˜vÑ&Ô&€FØ�‚{€{ÝŒ×Ò Ñ'Ô'Ð'Ð'Ð'ð €{r   c                 ó*   — t          | ¦  «        j        S )a�  Get the name of a device.

    Args:
        device (torch.device or int or str, optional): device for which to
            return the name. This function is a no-op if this argument is a
            negative integer. It uses the current device, given by :func:`~torch.xpu.current_device`,
            if :attr:`device` is ``None`` (default).

    Returns:
        str: the name of the device
    )Úget_device_propertiesÚnamer   s    r   Úget_device_namer�   Ë   s   € õ ! Ñ(Ô(Ô-Ð-r   c                 óX   ‡— t          | ¦  «        Šˆfd„t          ‰¦  «        D ¦   «         S )aÐ  Get the xpu capability of a device.

    Args:
        device (torch.device or int or str, optional): device for which to
            return the device capability. This function is a no-op if this
            argument is a negative integer. It uses the current device, given by
            :func:`~torch.xpu.current_device`, if :attr:`device` is ``None``
            (default).

    Returns:
        Dict[str, Any]: the xpu capability dictionary of the device
    c                 ó\   •— i | ](}|                      d ¦  «        °|t          ‰|¦  «        “Œ)S ))Ú__Ú
_pybind11_)Ú
startswithÚgetattr)rK   ÚpropÚpropss     €r   ú
<dictcomp>z)get_device_capability.<locals>.<dictcomp>î   sH   ø€ ð ð ð àØ�ŠÐ3Ñ4Ô4ðØ�g�e˜TÑ"Ô"ðð ð r   )rŽ   Údir)r   r˜   s    @r   Úget_device_capabilityr›   Ú   sC   ø€ õ " &Ñ)Ô)€Eðð ð ð å˜‘J”Jðñ ô ð r   c                 ó¬   — t          ¦   «          t          | d¬¦  «        } | dk     s| t          ¦   «         k    rt          d¦  «        ‚t	          | ¦  «        S )zêGet the properties of a device.

    Args:
        device (torch.device or int or str): device for which to return the
            properties of the device.

    Returns:
        _XpuDeviceProperties: the properties of the device
    Tr|   r   zInvalid device index)rE   r   r.   rS   Ú_get_device_propertiesr   s    r   rŽ   rŽ   õ   sS   € õ �L„L€LÝ˜v°Ð5Ñ5Ô5€FØ�‚z€z�V�|™~œ~Ò-Ð-ÝÐ3Ñ4Ô4Ð4Ý! &Ñ)Ô)Ð)r   c                  óZ   — t          ¦   «          t          j                             ¦   «         S )z0Return the index of a currently selected device.)rE   r   r   Ú_xpu_getDevicer   r   r   Úcurrent_devicer      s   € å�L„L€LÝŒ8×"Ò"Ñ$Ô$Ð$r   c                 ó®   — t          | t          ¦  «        rt          j        | ¦  «        } n*t          | t          ¦  «        rt          j        d| ¦  «        } | S )zŒReturn the torch.device type object from the passed in device.

    Args:
        device (torch.device or int or str): selected device.
    rk   )Ú
isinstancerX   r   r   ry   r   s    r   Ú_get_devicer£     sO   € õ �&�#ÑÔð -Ý”˜fÑ%Ô%ˆˆÝ	�F�CÑ	 Ô	 ð -Ý”˜e VÑ,Ô,ˆØ€Mr   c                   ó\   — e Zd ZU dZed         ed<   ded         fd„Zd„ Zdeded	efd
„Z	dS )ÚStreamContexta  Context-manager that selects a given stream.

    All XPU kernels queued within its context will be enqueued on a selected
    stream.

    Args:
        Stream (Stream): selected stream. This manager is a no-op if it's
            ``None``.
    .. note:: Streams are per-device.
    útorch.xpu.StreamÚ
cur_streamÚstreamc                 ó^   — || _         t          d d¦  «        | _        | j        €	d| _        d S d S )NTrd   )r¨   r   re   )rg   r¨   s     r   rh   zStreamContext.__init__&  s5   € ØˆŒÝ$ T¨4Ñ0Ô0ˆŒØŒ8ÐØˆDŒHˆHˆHð Ðr   c                 óŒ  — | j         }|�| j        dk    rd S t          j                             d ¦  «        | _        | j        j        |j        k    rUt          |j        ¦  «        5  t          j                             |j        ¦  «        | _        d d d ¦  «         n# 1 swxY w Y   t          j                             |¦  «         d S rc   )	r¨   re   r   rk   Úcurrent_streamÚsrc_prev_streamr   Údst_prev_streamÚ
set_stream)rg   r§   s     r   rm   zStreamContext.__enter__,  sú   € Ø”[ˆ
ØÐ ¤¨R¢ ØˆFÝ$œy×7Ò7¸Ñ=Ô=ˆÔð ÔÔ&¨*Ô*;Ò;Ð;Ý˜
Ô)Ñ*Ô*ð Sð SÝ',¤y×'?Ò'?À
Ô@QÑ'RÔ'R�Ô$ðSð Sð Sñ Sô Sð Sð Sð Sð Sð Sð Søøøð Sð Sð Sð SåŒ	×Ò˜ZÑ(Ô(Ð(Ð(Ð(s   Á$*BÂBÂ!Bro   rp   r=   c                 óì   — | j         }|�| j        dk    rd S | j        j        |j        k    r$t          j                             | j        ¦  «         t          j                             | j        ¦  «         d S rc   )r¨   re   r¬   r   r   rk   r®   r­   )rg   ro   rp   r=   r§   s        r   rt   zStreamContext.__exit__8  sl   € Ø”[ˆ
ØÐ ¤¨R¢ ØˆFð ÔÔ&¨*Ô*;Ò;Ð;ÝŒI× Ò  Ô!5Ñ6Ô6Ð6ÝŒ	×Ò˜TÔ1Ñ2Ô2Ð2Ð2Ð2r   N)
rv   rw   rx   r€   r   Ú__annotations__rh   rm   r   rt   r   r   r   r¥   r¥     s�   € € € € € € ð	ð 	ð Ð+Ô,Ð,Ð,Ñ,ð˜xÐ(:Ô;ð ð ð ð ð
)ð 
)ð 
)ð3˜Sð 3¨ð 3¸ð 3ð 3ð 3ð 3ð 3ð 3r   r¥   r¨   r¦   c                 ó    — t          | ¦  «        S )z³Wrap around the Context-manager StreamContext that selects a given stream.

    Arguments:
        stream (Stream): selected stream. This manager is a no-op if it's ``None``.
    )r¥   ©r¨   s    r   r¨   r¨   C  s   € õ ˜Ñ Ô Ð r   c                 óJ   — t           j                             | ||¬¦  «         dS )a  set stream specified by the stream id, device index and device type

    Args: stream_id (int): not visible to the user, used to assigned to the specific stream.
          device_index (int): selected device index.
          device_type (int): selected device type.
    ©Ú	stream_idÚdevice_indexÚdevice_typeN)r   r   Ú_xpu_setStreamr´   s      r   Ú_set_stream_by_idr¹   L  s6   € õ 
„H×ÒØØ!Øð ñ ô ð ð ð r   c                 ól   — | €dS t          ¦   «          t          | j        | j        | j        ¬¦  «         dS )a  Set the current stream.This is a wrapper API to set the stream.
        Usage of this function is discouraged in favor of the ``stream``
        context manager.

    Args:
        stream (Stream): selected stream. This function is a no-op
            if this argument is ``None``.
    Nr´   )rE   r¹   rµ   r¶   r·   r²   s    r   r®   r®   Z  sJ   € ð €~ØˆÝ�L„L€LÝØÔ"ØÔ(ØÔ&ðñ ô ð ð ð r   c                 óÂ   — t          ¦   «          t          j                             t	          | d¬¦  «        ¦  «        }t          |d         |d         |d         ¬¦  «        S )aR  Return the currently selected :class:`Stream` for a given device.

    Args:
        device (torch.device or int, optional): selected device. Returns
            the currently selected :class:`Stream` for the current device, given
            by :func:`~torch.xpu.current_device`, if :attr:`device` is ``None``
            (default).
    Tr|   r   r   é   r´   )rE   r   r   Ú_xpu_getCurrentStreamr   r   )r   Ú
streamdatas     r   r«   r«   m  sa   € õ �L„L€LÝ”×/Ò/Ý˜&¨4Ð0Ñ0Ô0ñô €Jõ Ø˜Q”-¨j¸¬mÈÐTUÌðñ ô ð r   c                 ó~   — t          ¦   «          t          | d¬¦  «        } t          j                             | ¦  «        S )a*  Wait for all kernels in all streams on a XPU device to complete.

    Args:
        device (torch.device or int, optional): device for which to synchronize.
            It uses the current device, given by :func:`~torch.xpu.current_device`,
            if :attr:`device` is ``None`` (default).
    Tr|   )rE   r   r   r   Ú_xpu_synchronizer   s    r   ÚsynchronizerÁ     s5   € õ �L„L€LÝ˜v°Ð5Ñ5Ô5€FÝŒ8×$Ò$ VÑ,Ô,Ð,r   c                  óŽ   — t          ¦   «         sg S t          j                             ¦   «         } | €g S |                      ¦   «         S )z<Return list XPU architectures this library was compiled for.)r0   r   r   Ú_xpu_getArchFlagsÚsplit)Ú
arch_flagss    r   Úget_arch_listrÆ   Œ  sC   € å‰>Œ>ð Øˆ	Ý”×+Ò+Ñ-Ô-€JØÐØˆ	Ø×ÒÑÔÐr   c                  óŒ   — t          ¦   «         } t          | ¦  «        dk    rdS dd                     d„ | D ¦   «         ¦  «        › �S )zIReturn XPU AOT(ahead-of-time) build flags this library was compiled with.r   rN   z-device ú,c              3   ó   K  — | ]}|V — Œd S rJ   r   )rK   Úarchs     r   rM   z$get_gencode_flags.<locals>.<genexpr>›  s"   è è € Ð:Ð:¨˜tÐ:Ð:Ð:Ð:Ð:Ð:r   )rÆ   ÚlenrY   )Ú	arch_lists    r   Úget_gencode_flagsrÍ   –  sJ   € å‘”€IÝ
ˆ9�~„~˜ÒÐØˆrØ<�c—h’hÐ:Ð:°	Ð:Ñ:Ô:Ñ:Ô:Ð<Ð<Ð<r   c                 ó^   — | j         }|€t          ¦   «         }t          j        j        |         S )zuReturn the XPU Generator object for the given device.

    Args:
        device (torch.device): selected device.
    )ra   r    r   rk   r   )r   re   s     r   Ú_get_generatorrÏ   ž  s+   € ð Œ,€CØ
€{ÝÑÔˆÝŒ9Ô'¨Ô,Ð,r   rk   Úoffsetc                 óR   ‡ ‡— t          |¦  «        Šˆˆ fd„}t          |¦  «         dS )a$  Set the random number generator state offset of the specified GPU.

    Args:
        offset (int): The desired offset
        device (torch.device or int, optional): The device to set the RNG state.
            Default: ``'xpu'`` (i.e., ``torch.device('xpu')``, the current XPU device).
    c                  óP   •— t          ‰¦  «        } |                      ‰¦  «         d S rJ   )rÏ   Ú
set_offset)Údefault_generatorÚfinal_devicerÐ   s    €€r   Úcbz!_set_rng_state_offset.<locals>.cb¶  s+   ø€ Ý*¨<Ñ8Ô8ÐØ×$Ò$ VÑ,Ô,Ð,Ð,Ð,r   N)r£   rC   )rÐ   r   rÖ   rÕ   s   `  @r   Ú_set_rng_state_offsetr×   ª  sB   øø€ õ ˜vÑ&Ô&€Lð-ð -ð -ð -ð -ð -õ ˆr�N„N€N€N€Nr   c                 ó‚   — t          ¦   «          t          | ¦  «        }t          |¦  «        }|                     ¦   «         S )aL  Return the random number generator state offset of the specified GPU.

    Args:
        device (torch.device or int, optional): The device to return the RNG state offset of.
            Default: ``'xpu'`` (i.e., ``torch.device('xpu')``, the current XPU device).

    .. warning::
        This function eagerly initializes XPU.
    )rE   r£   rÏ   Ú
get_offset)r   rÕ   rÔ   s      r   Ú_get_rng_state_offsetrÚ   ½  s:   € õ �L„L€LÝ˜vÑ&Ô&€LÝ& |Ñ4Ô4ÐØ×'Ò'Ñ)Ô)Ð)r   )
Úempty_cacheÚmax_memory_allocatedÚmax_memory_reservedÚmem_get_infoÚmemory_allocatedÚmemory_reservedÚmemory_statsÚmemory_stats_as_nested_dictÚreset_accumulated_memory_statsÚreset_peak_memory_stats)	Úget_rng_stateÚget_rng_state_allÚinitial_seedÚmanual_seedÚmanual_seed_allr9   r8   Úset_rng_stateÚset_rng_state_all)+r   r   r¥   r    r«   r   r   r‚   r.   rÛ   rÆ   r›   r�   rŽ   rÍ   rå   ræ   Ú
get_streamrF   rç   r0   r2   r6   rè   ré   rÜ   rÝ   rÞ   rß   rà   rá   râ   rã   rä   r9   r8   rŒ   rê   rë   r®   r¨   ÚstreamsrÁ   rJ   )rk   )`r€   Ú	threadingr=   Ú	functoolsr   Útypingr   r   r   r   r   r	   r
   r   Útorch._Cr   Ú_deviceÚtorch._utilsr   r   Ú_utilsr   rí   r   r   r4   ÚlocalrP   ÚLockrQ   r   rX   r°   r–   r   r5   ry   Ú	_device_tr;   r   Ú	GeneratorÚboolr!   r"   Ú_xpu_exchangeDevicer'   Ú_xpu_maybeExchangeDevicer*   r.   r0   r2   r6   rC   rF   rE   r`   r‚   rŒ   r�   r›   rŽ   r    r£   r¥   r¨   r¹   r®   r«   rÁ   rÆ   rÍ   rÏ   r×   rÚ   ÚmemoryrÛ   rÜ   rÝ   rÞ   rß   rà   rá   râ   rã   rä   Úrandområ   ræ   rç   rè   ré   r9   r8   rê   rë   Ú__all__r   r   r   ú<module>rÿ      s  ððð ð ð Ð Ð Ð Ø Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø DÐ DÐ DÐ DÐ DÐ DÐ DÐ DÐ DÐ DÐ DÐ DÐ DÐ DÐ DÐ DÐ DÐ Dà €€€Ø €€€Ø #Ð #Ð #Ð #Ð #Ð #Ø 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6à %Ð %Ð %Ð %Ð %Ð %Ø "Ð "Ð "Ð "Ð "Ð "Ð "Ð "ð €Ø€y„ÑÔ€Ø%�y”~Ñ'Ô'Ð ð ð ˆtØ	ˆ(�2�t�8Ô
˜d 3œiÐ
'Ô(ôð ð ñ ð �'˜%œ(Ð$6¸¸ÑFÔF€Ø�'˜3  TÐ)Ô*€	Ø%Ð%Ñ'Ô'Ð Ø02Ð �E˜%œ(Ô,Ô-Ð 2Ð 2Ñ 2ð�dð ð ð ð ð
 €<�>„>ð NØ œ8Ô8ÐØ”xÔ3ÐØ"œXÔ>ÐÐð '˜;Ð'=Ñ>Ô>ÐðN ð N¨ð Nð Nð Nð NðN sð N¨sð Nð Nð Nð Nð €�1ÐÑÔð*�cð *ð *ð *ñ Ôð*ð�dð ð ð ð ðð ð ð
2ð 2ð 2ð
Gð Gð Gðð ð ð%ð %ð %ðP
ð 
ð 
ð 
ð 
ñ 
ô 
ð 
ðð ð ð ð ñ ô ð ð(ð ð ð ð �ñ ô ð ð
(�yð 
( Tð 
(ð 
(ð 
(ð 
(ð.ð .˜H YÔ/ð .¸3ð .ð .ð .ð .ð €ˆ4�„ðð  (¨9Ô"5ð ÀÀcÈ3ÀhÄð ð ð ñ „ðð4*ð * (¨9Ô"5ð *ÐAUð *ð *ð *ð *ð"%˜ð %ð %ð %ð %ð
˜˜c 3¨¬Ð4Ô5ð 
¸%¼,ð 
ð 
ð 
ð 
ð'3ð '3ð '3ð '3ð '3ñ '3ô '3ð '3ðT!�8Ð.Ô/ð !°Mð !ð !ð !ð !ðð ð ð�vð ð ð ð ð&ð ˜8 IÔ.ð ¸&ð ð ð ð ð$
-ð 
-˜	ð 
-¨Tð 
-ð 
-ð 
-ð 
-ð�t˜C”yð ð ð ð ð=˜3ð =ð =ð =ð =ð	-˜5œ<ð 	-¨E¬HÔ,>ð 	-ð 	-ð 	-ð 	-ð :?ðð ØðØ˜s C¨¬Ð5Ô6ðà	ðð ð ð ð&*ð * %¨¨S°%´,Ð(>Ô"?ð *ÈCð *ð *ð *ð *ð"ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð,ð ,ð ,€€€r   