
    9i}                         % S SK r S SKJr  S SKrS SKJr  S SKJrJrJ	r	  S SK
Jr  Sq\\R                     \S'   \ R                  " S5      S 5       r " S	 S
\	5      rS rS rg)    N)Optional)_len_torch_function_stack)	_pop_mode
_push_modeTorchFunctionModecontext_decoratorCURRENT_DEVICE   c                     1 [         R                  i[         R                  i[         R                  i[         R                  i[         R
                  i[         R                  i[         R                  i[         R                  i[         R                  i[         R                  R                  i[         R                  R                  i[         R                  i[         R                  i[         R                  i[         R                   i[         R"                  i[         R$                  i[         R&                  R(                  i[         R*                  i[         R,                  i[         R.                  i[         R0                  i[         R2                  i[         R4                  i[         R6                  i[         R8                  i[         R:                  i[         R<                  i[         R>                  i[         R@                  i[         RB                  i[         RD                  i[         RF                  i[         RH                  i[         RJ                  i[         RL                  i$ N)'torchemptyempty_permutedempty_stridedempty_quantizedonesarangebartlett_windowblackman_windoweyefftfftfreqrfftfreqfullhamming_windowhann_windowkaiser_windowlinspacelogspacenestednested_tensorrandrandnrandintrandpermrangesparse_coo_tensorsparse_compressed_tensorsparse_csr_tensorsparse_csc_tensorsparse_bsr_tensorsparse_bsc_tensortril_indicestriu_indiceszerosasarraytensor	as_tensorscalar_tensor     S/var/www/html/land-doc-ocr/venv/lib/python3.13/site-packages/torch/utils/_device.py_device_constructorsr8      sF   )) 	) 		)
 	) 	

) 	) 	) 	) 			) 			) 			) 	

) 	) 	)  	!)" 	#)$ 	%)& 	""'), 	

-). 	/)0 	1)2 	3)4 	5)6 	7)8 	&&9): 	;)< 	=)> 	?)@ 	A)B 	C)D 	E)F 	G)H 	I)L 	M)N 	O)P 	Q) )r6   c                   0    \ rS rSrS rS rS rSS jrSrg)	DeviceContext=   c                 :    [         R                  " U5      U l        g r   )r   device)selfr=   s     r7   __init__DeviceContext.__init__>   s    ll6*r6   c                     [         U l        U R                  q [        [	        5       5       Vs/ s H  n[        5       PM     nn[        U 5        [        U5       H  n[        U5        M     g s  snf r   )r
   
old_devicer=   r'   r   r   r   reversed)r>   _	cur_stackmodes       r7   	__enter__DeviceContext.__enter__A   sZ    (
 +00I0K*LM*LQY[*L	M4Y'Dt (	 Ns   A,c                 V   U R                   q/ n[        [        5       S-
  5       H5  n[	        5       n[        U[        5      (       a   eUR                  U5        M7     [        5       S:  a!  [	        5       n[        U[        5      (       d   e[        U5       H  n[        U5        M     g )Nr   r   )
rB   r
   r'   r   r   
isinstancer:   appendrC   r   )r>   exc_typeexc_valexc_tbrE   rD   rF   s          r7   __exit__DeviceContext.__exit__P   s    	 02Q67A;D!$6666T" 8
 %&*;DdM2222Y'Dt (r6   Nc                     U=(       d    0 nU[        5       ;   a!  UR                  S5      c  U R                  US'   U" U0 UD6$ )Nr=   )r8   getr=   )r>   functypesargskwargss        r7   __torch_function__ DeviceContext.__torch_function__c   sC    2'))fjj.B.J#{{F8T$V$$r6   )r=   rB   )r5   N)	__name__
__module____qualname____firstlineno__r?   rG   rO   rW   __static_attributes__r5   r6   r7   r:   r:   =   s    +&%r6   r:   c                 $   ^  [        U 4S jU5      $ )Nc                     > T $ r   r5   r=   s   r7   <lambda>"device_decorator.<locals>.<lambda>l   s    Vr6   r   )r=   rS   s   ` r7   device_decoratorrc   k   s    ^T22r6   c                    ^  U 4S j$ )z
Set the default device inside of the wrapped function by decorating it with this function.

If you would like to use this as a context manager, use device as a
context manager directly, e.g., ``with torch.device(device)``.
c                 D   > [        [        R                  " T5      U 5      $ r   )rc   r   r=   )rS   r=   s    r7   ra   set_device.<locals>.<lambda>v   s    (f)=tDr6   r5   r`   s   `r7   
set_devicerg   o   s     EDr6   )	functoolstypingr   r   torch._Cr   torch.overridesr   r   r   torch.utils._contextlibr	   r
   r=   __annotations__	lru_cacher8   r:   rc   rg   r5   r6   r7   <module>ro      sh       . D D 5 *.& - Q* *\*%% *%\3Er6   