
    3Ki                         % S SK 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-  \S'   \ R                  " S5      S 5       r " S S	\5      rS
 rS rg)    N)_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     U/var/www/html/dynamic-report/venv/lib/python3.13/site-packages/torch/utils/_device.py_device_constructorsr7      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) )r5   c                   4    \ rS rSrSS jrS rS rS	S jrSrg)
DeviceContext<   Nc                 :    [         R                  " U5      U l        g r   )r   device)selfr<   s     r6   __init__DeviceContext.__init__=   s    ll6*r5   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       r6   	__enter__DeviceContext.__enter__A   sZ    (
 +00I0K*LM*LQY[*L	M4Y'Dt (	 Ns   A,c                 z   U R                   q/ n[        [        5       S-
  5       H>  n[	        5       n[        U[        5      (       a  [        S5      eUR                  U5        M@     [        5       S:  a*  [	        5       n[        U[        5      (       d  [        S5      e[        U5       H  n[        U5        M     g )Nr
   z@Found nested DeviceContext on the mode stack where none expectedr   z8Expected a DeviceContext at the bottom of the mode stack)rA   r	   r&   r   r   
isinstancer9   AssertionErrorappendrB   r   )r=   exc_typeexc_valexc_tbrD   rC   rE   s          r6   __exit__DeviceContext.__exit__P   s    	 02Q67A;D$..$V  T" 8 %&*;DdM22$N  Y'Dt (r5   c                     U=(       d    0 nU[        5       ;   a!  UR                  S5      c  U R                  US'   U" U0 UD6$ )Nr<   )r7   getr<   )r=   functypesargskwargss        r6   __torch_function__ DeviceContext.__torch_function__i   sC    2'))fjj.B.J#{{F8T$V$$r5   )r<   rA   )returnN)r4   N)	__name__
__module____qualname____firstlineno__r>   rF   rO   rW   __static_attributes__r4   r5   r6   r9   r9   <   s    +2%r5   r9   c                 $   ^  [        U 4S jU5      $ )Nc                     > T $ r   r4   r<   s   r6   <lambda>"device_decorator.<locals>.<lambda>r   s    Vr5   r   )r<   rS   s   ` r6   device_decoratorrd   q   s    ^T22r5   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   )rd   r   r<   )rS   r<   s    r6   rb   set_device.<locals>.<lambda>|   s    (f)=tDr5   r4   ra   s   `r6   
set_devicerh   u   s     EDr5   )	functoolsr   torch._Cr   torch.overridesr   r   r   torch.utils._contextlibr   r	   r<   __annotations__	lru_cacher7   r9   rd   rh   r4   r5   r6   <module>ro      se      . D D 5 '+t# * Q* *\1%% 1%j3Er5   