ó
    !Eñi J  ã            	       óò  • % S r SSKrSSKrSSKJr  SSKJr  SSKrSSKJr  SSK	J
r
Jr  SSKJr  SSKJr  S	S
KJr  \R$                  r\R&                  rSr\\R,                  R.                  S4   \S'   Sq/ q\\\/ S4   \\   4      \S'   \R:                  " 5       r\R>                  " 5       r \" 5       q!\"" \R,                  S5      (       a  \R,                  RF                  r$O	S\%S\%4S jr$\"" \R,                  S5      (       a  \R,                  RL                  r'O	S\%S\%4S jr'S r(S r)S r*S\+4S jr,SFS jr- " S S\.5      r/S\+4S jr0S\+4S jr1SGS\SS4S jjr2S\%4S  jr3S\%4S! jr4SGS\S\4S" jjr5SGS\S\4S# jjr6 SHS$\S-  S%\S&\%SS4S' jjr7S\8\\4   4S( jr9S)\\%\%\%\%/S4   SS4S* jr:SIS+\+4S, jjr;SGS\S\\%\%4   4S- jjr<SFS. jr=S/\4S0 jr>S\SS4S1 jr?SGS\S\8\\4   4S2 jjr@ " S3 S5      rA " S4 S55      rBS6 rCS/\S-  S\B4S7 jrDSJS\S\4S8 jjrES\\   4S9 jrFSJS:\S\SS4S; jjrGS<\\   SS4S= jrHS>\%SS4S? jrIS>\%SS4S@ jrJS\%4SA jrKS\%4SB jrLS\%4SC jrMS	SDKN7  S	SDKO7  / SEQrPg)KzH
This package enables an interface for accessing MTIA backend in python
é    N)ÚCallable)ÚAny)ÚTensor)Ú	is_fbcodeÚis_prod)Ú_LazySeedTracker)ÚDeviceé   )Ú_get_device_index© .Údefault_generatorsFÚ_queued_callsÚ_mtia_exchangeDeviceÚdeviceÚreturnc                 ó&   • U S:  a  g[        S5      e©Nr   éÿÿÿÿz)PyTorch was compiled without MTIA support©ÚRuntimeError©r   s    ÚP/home/mande/repo/quber/.venv/lib/python3.13/site-packages/torch/mtia/__init__.pyÚ_exchange_devicer   )   ó   € Ø�A‹:ØÜÐFÓGÐGó    Ú_mtia_maybeExchangeDevicec                 ó&   • U S:  a  g[        S5      er   r   r   s    r   Ú_maybe_exchange_devicer   3   r   r   c                  ó   • [        5         g ©N)Ú
_lazy_initr   r   r   Úinitr"   9   s   € Ü…Lr   c                  ó:   • [         =(       a    [        5       (       + $ )z9Return whether PyTorch's MTIA state has been initialized.)Ú_initializedÚ_is_in_bad_forkr   r   r   Úis_initializedr&   =   s   € ä×1¤Ó 1Ô1Ð1r   c                 óÚ  • [            [        5       (       a  U " 5       sS S S 5        $ UR                  SS5      (       a*  [        R	                  U [
        R                  " 5       5        OkUR                  SS5      (       a*  [        R                  U [
        R                  " 5       5        O*[        R                  U [
        R                  " 5       45        S S S 5        g ! , (       d  f       g = f)NÚseed_allFÚseed)
Ú_initialization_lockr&   ÚgetÚ_lazy_seed_trackerÚqueue_seed_allÚ	tracebackÚformat_stackÚ
queue_seedr   Úappend)ÚcallableÚkwargss     r   Ú
_lazy_callr4   B   s™   € Þ	Ü×ÑÙ“:÷ 
Ñ	ð
 �z‰z˜* e×,Ñ,Ü"×1Ñ1°(¼I×<RÒ<RÓ<TÕUØ—‘˜F E×*Ñ*Ü"×-Ñ-¨h¼	×8NÒ8NÓ8PÕQä×$Ñ$ h´	×0FÒ0FÓ0HÐ%IÔJ÷ 
×	Ö	ús   ‡C§B,CÃ
C*c                  ó>   • [         R                  R                  5       $ r    )ÚtorchÚ_CÚ_mtia_isInBadForkr   r   r   r%   r%   P   s   € Ü�8‰8×%Ñ%Ó'Ð'r   c            	      óZ  • [        5       (       d  [        [        S5      (       a  g [           [        5       (       a
   S S S 5        g [	        5       (       a  [        S5      e[        5       (       d  [        S5      e[        5       (       a&  [        5       (       a   SSK
Jn   U R                  5         [        R                  R!                  5         S[        l        [$        R'                  S [(        R+                  5        5       5         [$         H  u  p U" 5         M     [5        [        S5        SqS S S 5        g ! [         a     N–f = f! [,         a1  nS[/        U5       S	S
R1                  U5       3n[3        U5      UeS nAff = f! [5        [        S5        f = f! , (       d  f       g = f)NÚis_initializingzwCannot re-initialize MTIA in forked subprocess. To use MTIA with multiprocessing, you must use the 'spawn' start methodzÖTorch not compiled with MTIA enabled. Ensure you have `import mtia.host_runtime.torch_mtia.dynamic_library` in your python src file and include `//mtia/host_runtime/torch_mtia:torch_mtia` as your target dependency!r   )Úcxx_resource_managerTc              3   ó6   #   • U  H  o(       d  M  Uv •  M     g 7fr    r   )Ú.0Úcallss     r   Ú	<genexpr>Ú_lazy_init.<locals>.<genexpr>�   s   é € ÐXÒ0N uÓRWŸU™UÒ0Nùs   ‚
�	z6MTIA call failed lazily at initialization with error: z(

MTIA call was originally invoked at:

Ú )r&   ÚhasattrÚ_tlsr*   r%   r   Ú_is_compiledÚAssertionErrorr   r   Úlibfb.py.cxx_resourcesr;   ÚinstallÚModuleNotFoundErrorr6   r7   Ú
_mtia_initr:   r   Úextendr,   Ú	get_callsÚ	ExceptionÚstrÚjoinÚDeferredMtiaCallErrorÚdelattrr$   )r;   Úqueued_callÚorig_tracebackÚeÚmsgs        r   r!   r!   T   s}  € ä×Ñœ7¤4Ð):×;Ñ;ØÞ	ô ×ÑØ÷ 
Ð	ô ×ÑÜðIóð ô �~‰~Ü ð*óð ô �;‰;œ7Ÿ9™9ðÝGà$×,Ñ,Ô.ô
 	�‰×ÑÔð  $ŒÔä×ÑÑXÔ0B×0LÑ0LÔ0NÓXÔXð	-ß/<Ñ+�ð<Ù–Mñ 0=ô ”DÐ+Ô,Øˆ÷o 
Ð	øô> 'ó áðûô  !ó <àPÔQTÐUVÓQWÐPXð YCØCEÇ7Á7È>ÓCZÐB[ð]ð ô 0°Ó4¸!Ð;ûð<ûô ”DÐ+Õ,ú÷m 
Õ	úss   ¬FÁAFÂD9Â/AFÄFÄE	ÄFÄFÄ9
EÅFÅEÅFÅ	
FÅ,E?Å?FÆFÆFÆFÆ
F*c                   ó   • \ rS rSrSrg)rO   é’   r   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__static_attributes__r   r   r   rO   rO   ’   s   † Úr   rO   c                  ó>   • [         R                  R                  5       $ )z*Return true if compiled with MTIA support.)r6   r7   Ú_mtia_isBuiltr   r   r   rD   rD   –   s   € ä�8‰8×!Ñ!Ó#Ð#r   c                  ó<   • [        5       (       d  g[        5       S:„  $ )z'Return true if MTIA device is availableFr   )rD   Údevice_countr   r   r   Úis_availabler`   ›   s   € ä�>‰>Øä‹>˜AÑÐr   c                 ó²   • [         R                  R                  U 5         [         R                  R	                  5       sSSS5        $ ! , (       d  f       g= f)z?Waits for all jobs in all streams on a MTIA device to complete.N)r6   Úmtiar   r7   Ú_mtia_deviceSynchronizer   s    r   Úsynchronizerd   £   s0   € ä	�‰×	Ñ	˜6Õ	"Ü�x‰x×/Ñ/Ó1÷ 
#×	"×	"ús    AÁ
Ac                  ó>   • [         R                  R                  5       $ )z,Return the number of MTIA devices available.)r6   r7   Ú_mtia_getDeviceCountr   r   r   r_   r_   ©   ó   € ô �8‰8×(Ñ(Ó*Ð*r   c                  ó>   • [         R                  R                  5       $ )z0Return the index of a currently selected device.)r6   r7   Ú%_accelerator_hooks_get_current_devicer   r   r   Úcurrent_devicerj   ¯   s   € ä�8‰8×9Ñ9Ó;Ð;r   c                 óP   • [         R                  R                  [        U SS95      $ )a;  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.mtia.current_device`, if :attr:`device` is ``None``
        (default).
T©Úoptional)r6   r7   Ú_mtia_getCurrentStreamr   r   s    r   Úcurrent_streamro   ´   ó!   € ô �8‰8×*Ñ*Ô+<¸VÈdÑ+SÓTÐTr   c                 óP   • [         R                  R                  [        U SS95      $ )a%  Return the default :class:`Stream` for a given device.

Args:
    device (torch.device or int, optional): selected device. Returns
        the default :class:`Stream` for the current device, given by
        :func:`~torch.mtia.current_device`, if :attr:`device` is ``None``
        (default).
Trl   )r6   r7   Ú_mtia_getDefaultStreamr   r   s    r   Údefault_streamrs   À   rp   r   ÚenabledÚstacksÚmax_entriesc                 ód   • [        5       (       d  g[        R                  R                  XU5        g)ay  Enable/Disable the memory profiler on MTIA allocator

Args:
    enabled (all or state, optional) selected device. Returns
        statistics for the current device, given by current_device(),
        if device is None (default).

    stacks ("python" or "cpp", optional). Select the stack trace to record.

    max_entries (int, optional). Maximum number of entries to record.
N)r&   r6   r7   Ú_mtia_recordMemoryHistory)rt   ru   rv   s      r   Úrecord_memory_historyry   Ì   s$   € ô ×ÑØÜ	‡H�H×&Ñ& w¸ÕDr   c                  ó>   • [         R                  R                  5       $ )z4Return a dictionary of MTIA memory allocator history)r6   r7   Ú_mtia_memorySnapshotr   r   r   Úsnapshotr|   ß   rg   r   Úobserverc                 óB   • [         R                  R                  U 5        g)z9Attach an out-of-memory observer to MTIA memory allocatorN)r6   r7   Ú_mtia_attachOutOfMemoryObserver)r}   s    r   Úattach_out_of_memory_observerr€   å   s   € ô 
‡H�H×,Ñ,¨XÕ6r   Úincluding_emulationc                 ó   • g)zLReturn a bool indicating if the current MTIA device supports dtype bfloat16.Tr   )r�   s    r   Úis_bf16_supportedrƒ   ì   s   € àr   c                 óP   • [         R                  R                  [        U SS95      $ )a  Return capability of a given device as a tuple of (major version, minor version).

Args:
    device (torch.device or int, optional) selected device. Returns
        statistics for the current device, given by current_device(),
        if device is None (default).
Trl   )r6   r7   Ú_mtia_getDeviceCapabilityr   r   s    r   Úget_device_capabilityr†   ñ   ó"   € ô �8‰8×-Ñ-Ô.?ÀÐQUÑ.VÓWÐWr   c                  ó>   • [         R                  R                  5       $ )zEmpty the MTIA device cache.)r6   r7   Ú_mtia_emptyCacher   r   r   Úempty_cacherŠ   ü   s   € ä�8‰8×$Ñ$Ó&Ð&r   Ústreamc                 óJ   • U c  g[         R                  R                  U 5        g)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``.
N)r6   r7   Ú_mtia_setCurrentStream©r‹   s    r   Ú
set_streamr�     s   € ð �~ØÜ	‡H�H×#Ñ# FÕ+r   c                 óf   • [        U 5      n U S:¼  a   [        R                  R                  U 5        gg)z‘Set the current device.

Args:
    device (torch.device or int): selected device. This function is a no-op
        if this argument is negative.
r   N)r   r6   r7   Ú%_accelerator_hooks_set_current_devicer   s    r   Ú
set_devicer’     s,   € ô ˜vÓ&€FØ�ƒ{Ü�‰×6Ñ6°vÕ>ð r   c                 óP   • [         R                  R                  [        U SS95      $ )zäReturn a dictionary of MTIA device properties

Args:
    device (torch.device or int, optional) selected device. Returns
        statistics for the current device, given by current_device(),
        if device is None (default).
Trl   )r6   r7   Ú_mtia_getDevicePropertiesr   r   s    r   Úget_device_propertiesr•     r‡   r   c                   óB   • \ rS rSrSrS \4S jrS rS\S\S\4S jrS	r	g
)r   i&  z¼Context-manager that changes the selected device.

Args:
    device (torch.device or int): device index to select. It's a no-op if
        this argument is a negative integer or ``None``.
c                 ó0   • [        USS9U l        SU l        g )NTrl   r   )r   ÚidxÚprev_idx)Úselfr   s     r   Ú__init__Údevice.__init__.  s   € Ü$ V°dÑ;ˆŒØˆ�r   c                 ó`   • [         R                  R                  U R                  5      U l        g r    )r6   r7   Ú(_accelerator_hooks_maybe_exchange_devicer˜   r™   )rš   s    r   Ú	__enter__Údevice.__enter__2  s   € ÜŸ™×IÑIÈ$Ï(É(ÓSˆ�r   ÚtypeÚvaluer.   c                 ó`   • [         R                  R                  U R                  5      U l        g)NF)r6   r7   rž   r™   r˜   )rš   r¡   r¢   r.   s       r   Ú__exit__Údevice.__exit__5  s   € Ü—8‘8×DÑDÀTÇ]Á]ÓSˆŒØr   )r˜   r™   N)
rW   rX   rY   rZ   Ú__doc__r   r›   rŸ   r¤   r[   r   r   r   r   r   &  s3   † ñð˜sô òTð˜Sð ¨ð ¸÷ r   c                   óZ   • \ rS rSr% Sr\S-  \S'   S\S-  4S jrS rS\	S	\	S
\	4S jr
Srg)ÚStreamContexti:  a  Context-manager that selects a given stream.

All MTIA 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.
NÚ
cur_streamr‹   c                 óÞ  • S U l         Xl        [        S S5      U l        [        R
                  R                  5       (       d  U R                  c  SU l        [        R
                  R                  5       (       d  S O[        R                  R                  S 5      U l	        [        R
                  R                  5       (       d  S U l
        g [        R                  R                  S 5      U l
        g )NTr   )r©   r‹   r   r˜   r6   ÚjitÚis_scriptingrb   rs   Úsrc_prev_streamÚdst_prev_stream)rš   r‹   s     r   r›   ÚStreamContext.__init__H  s«   € ØˆŒØŒÜ$ T¨4Ó0ˆŒÜ�y‰y×%Ñ%×'Ñ'Ø�x‰xÑØ�”ô Ÿ	™	×.Ñ.×0Ñ0‰D´e·j±j×6OÑ6OÐPTÓ6Uð 	Ôô Ÿ	™	×.Ñ.×0Ñ0ˆDð 	ÕÜ6;·j±j×6OÑ6OÐPTÓ6Uð 	Õr   c                 óÌ  • U R                   nUb  U R                  S:X  a  g [        R                  R	                  S 5      U l        U R
                  R                  UR                  :w  aL  [        UR                  5         [        R                  R	                  UR                  5      U l        S S S 5        [        R                  R                  U5        g ! , (       d  f       N.= f©Nr   )	r‹   r˜   r6   rb   ro   r­   r   r®   r�   )rš   r©   s     r   rŸ   ÚStreamContext.__enter__W  sœ   € à—[‘[ˆ
àÑ §¡¨R£ØÜ$Ÿz™z×8Ñ8¸Ó>ˆÔð ×Ñ×&Ñ&¨*×*;Ñ*;Ó;Ü˜
×)Ñ)Õ*Ü',§z¡z×'@Ñ'@À×ARÑARÓ'S�Ô$÷ +ä�
‰
×Ñ˜jÕ)÷ +Õ*ús   Á>/CÃ
C#r¡   r¢   r.   c                 ó0  • U R                   nUb  U R                  S:X  a  g U R                  R                  UR                  :w  a)  [        R
                  R                  U R                  5        [        R
                  R                  U R                  5        g r±   )r‹   r˜   r­   r   r6   rb   r�   r®   )rš   r¡   r¢   r.   r©   s        r   r¤   ÚStreamContext.__exit__f  sj   € à—[‘[ˆ
àÑ §¡¨R£Øð ×Ñ×&Ñ&¨*×*;Ñ*;Ó;Ü�J‰J×!Ñ! $×"6Ñ"6Ô7Ü�
‰
×Ñ˜d×2Ñ2Õ3r   )r©   r®   r˜   r­   r‹   )rW   rX   rY   rZ   r¦   ÚStreamÚ__annotations__r›   rŸ   r   r¤   r[   r   r   r   r¨   r¨   :  sB   ‡ ñ	ð ˜‘Óð
˜v¨™}ô 
ò*ð4˜Sð 4¨ð 4¸÷ 4r   r¨   c                 óD   • [         R                  R                  XU5        g)zÒset stream specified by the stream id, device index and
    device type

Args: stream_id (int): stream id in stream pool
      device_index (int): device index in topo
      device_type (int): enum device type
N)r6   r7   Ú_mtia_setStream)Ú	stream_idÚdevice_indexÚdevice_types      r   Ú_set_stream_by_idr¼   t  s   € ô 
‡H�H×Ñ˜Y°kÕBr   c                 ó   • [        U 5      $ )a  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``.
.. note:: In eager mode stream is of type Stream class while in JIT it doesn't support torch.mtia.stream
)r¨   rŽ   s    r   r‹   r‹     s   € ô ˜Ó Ð r   c                 óv   • [        5         [        U SS9nUc
  [        5       n[        U   nUR	                  5       $ )aC  Returns the random number generator state of the specified MTIA device as a ByteTensor.

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

.. warning::
    This function eagerly initializes MTIA.
Trl   )r!   r   rj   r   Ú	get_state)r   r˜   Údefault_generators      r   Úget_rng_staterÁ   Š  s<   € ô „LÜ
˜F¨TÑ
2€CØ
�{ÜÓˆÜ*¨3Ñ/ÐØ×&Ñ&Ó(Ð(r   c                  óh   • [        [        5       5       V s/ s H  n [        U 5      PM     nn U$ s  sn f )zRReturns a list of ByteTensor representing the random number states of all devices.)Úranger_   rÁ   )ÚiÚresultss     r   Úget_rng_state_allrÆ   œ  s/   € ä).¬|«~Ô)>Ó?Ò)> AŒ}˜QÖÑ)>€GÐ?Ø€Nùò @s   –/Ú	new_statec                 ó"  ^ ^• [        5       (       dD  [        R                  R                  5          T R	                  [        R
                  S9m SSS5        [        USS9mTc
  [        5       mUU 4S jn[        U5        g! , (       d  f       N8= f)a$  Sets the random number generator state of the specified MTIA device.

Args:
    new_state (torch.ByteTensor): The desired state
    device (torch.device or int, optional): The device to set the RNG state.
        Default: ``'mtia'`` (i.e., ``torch.device('mtia')``, the current mtia device).
)Úmemory_formatNTrl   c                  ó:   >• [         T   n U R                  T5        g r    )r   Ú	set_state)rÀ   r˜   rÇ   s    €€r   ÚcbÚset_rng_state.<locals>.cb´  s   ø€ Ü.¨sÑ3ÐØ×#Ñ# IÕ.r   )	r&   r6   r7   Ú_DisableFuncTorchÚcloneÚcontiguous_formatr   rj   r4   )rÇ   r   rÌ   r˜   s   `  @r   Úset_rng_staterÑ   ¢  sm   ù€ ô ×ÑÜ�X‰X×'Ñ'Õ)ð "Ÿ™´e×6MÑ6M˜ÐNˆI÷ *ô
 ˜F¨TÑ
2€CØ
�{ÜÓˆö/ô ˆr…N÷ *Õ)ús   °B Â 
BÚ
new_statesc                 óB   • [        U 5       H  u  p[        X!5        M     g)z�Sets the random number generator state of all devices.

Args:
    new_states (Iterable of torch.ByteTensor): The desired state for each device.
N)Ú	enumeraterÑ   )rÒ   rÄ   Ústates      r   Úset_rng_state_allrÖ   »  s   € ô ˜jÖ)‰ˆÜ�eÖò *r   r)   c                 ó<   ^ • [        T 5      m U 4S jn[        USS9  g)au  Sets the seed for generating random numbers for the current MTIA device.
It's safe to call this function if MTIA is not available; in that case, it is silently ignored.

Args:
    seed (int): The desired seed.

.. warning::
    If you are working with a multi-GPU model, this function is insufficient
    to get determinism.  To seed all GPUs, use :func:`manual_seed_all`.
c                  óN   >• [        5       n [        U    nUR                  T5        g r    )rj   r   Úmanual_seed)r˜   rÀ   r)   s     €r   rÌ   Úmanual_seed.<locals>.cbÒ  s$   ø€ ÜÓˆÜ.¨sÑ3ÐØ×%Ñ% dÕ+r   T©r)   N©Úintr4   ©r)   rÌ   s   ` r   rÙ   rÙ   Å  s   ø€ ô ˆt‹9€Dõ,ô
 ˆr˜Ór   c                 ó<   ^ • [        T 5      m U 4S jn[        USS9  g)zÊSets the seed for generating random numbers on all MTIA devices.
It's safe to call this function if MTIA is not available; in that case, it is silently ignored.

Args:
    seed (int): The desired seed.
c                  ón   >• [        [        5       5       H  n [        U    nUR                  T5        M     g r    )rÃ   r_   r   rÙ   )rÄ   rÀ   r)   s     €r   rÌ   Úmanual_seed_all.<locals>.cbã  s-   ø€ Ü”|“~Ö&ˆAÜ 2°1Ñ 5ÐØ×)Ñ)¨$Ö/ò 'r   T©r(   NrÜ   rÞ   s   ` r   Úmanual_seed_allrã   Ú  s   ø€ ô ˆt‹9€Dõ0ô
 ˆr˜DÓ!r   c                  ó   • S n [        U SS9$ )ad  Sets the seed for generating random numbers to a random number for the current MTIA device.
It's safe to call this function if MTIA is not available; in that case, it is silently ignored.

.. warning::
    If you are working with a multi-GPU model, this function will only initialize
    the seed on one GPU.  To initialize all GPUs, use :func:`seed_all`.
c                  óH   • [        5       n [        U    nUR                  5       $ r    )rj   r   r)   )r˜   rÀ   s     r   rÌ   Úseed.<locals>.cbô  s$   € ÜÓˆÜ.¨sÑ3ÐØ ×%Ñ%Ó'Ð'r   TrÛ   ©r4   ©rÌ   s    r   r)   r)   ë  s   € ò(ô
 �b˜tÑ$Ð$r   c                  ó   • S n [        U SS9$ )zµSets the seed for generating random numbers to a random number on all MTIA devices.

It's safe to call this function if MTIA is not available; in that case, it is silently ignored.
c                  ó¬   • Sn Sn[        [        5       5       H8  n[        U   nU(       d  UR                  5       n SnM'  UR	                  U 5        M:     U $ )Nr   FT)rÃ   r_   r   r)   rÙ   )Úrandom_seedÚseededrÄ   rÀ   s       r   rÌ   Úseed_all.<locals>.cb  sT   € ØˆØˆÜ”|“~Ö&ˆAÜ 2°1Ñ 5ÐÞØ/×4Ñ4Ó6�Ø’à!×-Ñ-¨kÖ:ñ 'ð Ðr   Trâ   rç   rè   s    r   r(   r(   ü  s   € ò
ô �b 4Ñ(Ð(r   c                  óX   • [        5         [        5       n [        U    R                  5       $ )zvReturns the current random seed of the current MTIA device.

.. warning::
    This function eagerly initializes MTIA.
)r!   rj   r   Úinitial_seed)r˜   s    r   rï   rï     s%   € ô „LÜ
Ó
€CÜ˜cÑ"×/Ñ/Ó1Ð1r   )Ú*)#r"   r`   r&   rd   r_   rj   ro   rs   Úmemory_statsÚmax_memory_allocatedÚmemory_allocatedÚreset_peak_memory_statsr†   r•   ry   r|   r€   rŠ   r’   r�   r‹   r   rÑ   rÁ   rÖ   rÆ   rÙ   rã   r)   r(   rï   rƒ   Ú	MTIAGraphÚgraphÚgraph_pool_handle)r   Nr    )ÚallÚpythonr   )T)rb   )Qr¦   Ú	threadingr.   Úcollections.abcr   Útypingr   r6   r   Útorch._environmentr   r   Útorch._utilsr   Útorch.typesr	   Ú_utilsr   ÚEventrµ   r   Útupler7   Ú	Generatorr¶   r$   r   ÚlistrM   ÚlocalrC   ÚLockr*   r,   rB   r   r   rÝ   r   r   r"   r&   r4   Úboolr%   r!   rL   rO   rD   r`   rd   r_   rj   ro   rs   ry   Údictr|   r€   rƒ   r†   rŠ   r�   r’   r•   r   r¨   r¼   r‹   rÁ   rÆ   rÑ   rÖ   rÙ   rã   r)   r(   rï   ÚmemoryÚ
mtia_graphÚ__all__r   r   r   Ú<module>r     s‡  ðòó Û Ý $Ý ã Ý ß 1Ý )Ý å %ð 	�‰€Ø	�‰€ð 68Ð �E˜%Ÿ(™(×,Ñ,¨cÐ1Ñ2Ó 7ð €ð ð ˆtØ	ˆ(�2�t�8Ñ
˜d 3™iÐ
'Ñ(ñó ð ‡‚Ó€Ø —~’~Ó'Ð Ù%Ó'Ð ñ ˆ5�8‰8Ð+×,Ñ,Ø—x‘x×4Ñ4ÑðH ð H¨ô Hñ ˆ5�8‰8Ð0×1Ñ1Ø"ŸX™X×?Ñ?ÑðH sð H¨sô Hòò2ò
Kð(˜ô (ô;ô|	˜Iô 	ð$�dô $ð
�dô ñ2˜ð 2¨$õ 2ð+�cô +ð<˜ô <ñ
	U˜6ð 	U¨Võ 	Uñ	U˜6ð 	U¨Võ 	Uð MNñEØ�4‰ZðEØ),ðEØFIðEà	õEð&+�$�s˜C�x‘.ô +ð7Ø˜˜S # sÐ+¨TÐ1Ñ2ð7à	ô7ñ¨4õ ñ
X &ð X°E¸#¸s¸(±Oõ Xô'ð
,�vô ,ð	?�vð 	? $ô 	?ñX &ð X°D¸¸c¸±Nõ X÷ñ ÷(74ñ 74òtCð!�6˜D‘=ð ! ]ô !ñ)˜&ð )¨fõ )ð$˜4 ™<ô ñ˜Vð ¨Vð Àõ ð2  $ v¡,ð  °4ô  ð�cð ˜dô ð*"˜#ð " $ô "ð"%ˆcô %ð")�#ô )ð*2�cô 2ô Ü ò$�r   