
    '}h
                         U d dl mZ d dlZd dlmZ d dlmZ d dlZdaeej                     e
d<    ej                  d      d        Z G d d	e      Zd
 Zd Zy)    )OptionalN)TorchFunctionModecontext_decoratorCURRENT_DEVICE   c                  B   h t         j                  t         j                  t         j                  t         j                  t         j
                  t         j                  t         j                  t         j                  t         j                  t         j                  j                  t         j                  j                  t         j                  t         j                  t         j                  t         j                   t         j"                  t         j$                  t         j&                  t         j(                  j*                  t         j
                  t         j,                  t         j.                  t         j0                  t         j2                  t         j4                  t         j6                  t         j8                  t         j:                  t         j<                  t         j>                  t         j@                  t         jB                  t         jD                  t         jF                  t         jH                  t         jJ                  t         jL                  t         jN                  t         jP                  t         jJ                  S N))torchemptyempty_permutedempty_stridedempty_quantizedonesarangebartlett_windowblackman_windoweyefftfftfreqrfftfreqfullfill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vanderzerosasarraytensor	as_tensorscalar_tensor     R/var/www/html/test/engine/venv/lib/python3.12/site-packages/torch/utils/_device.py_device_constructorsr7   	   s   -- 	- 		-
 	- 	

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

- 	

- 	-  	!-" 	#-$ 	%-& 	'-( 	"")-. 	

/-0 	

1-2 	3-4 	5-6 	7-8 	9-: 	;-< 	&&=-> 	?-@ 	A-B 	C-D 	E-F 	G-H 	I-J 	K-L 	M-N 	O-R 	S-T 	U-V 	W-X 	Y- -r5   c                   6     e Zd Zd Z fdZ fdZddZ xZS )DeviceContextc                 8    t        j                  |      | _        y r
   )r   device)selfr;   s     r6   __init__zDeviceContext.__init__<   s    ll6*r5   c                 N    t         | _        | j                  a t        |          S r
   )r   
old_devicer;   super	__enter__)r<   	__class__s    r6   rA   zDeviceContext.__enter__?   s!    (w ""r5   c                 >    | j                   at        |   |||      S r
   )r?   r   r@   __exit__)r<   exc_typeexc_valexc_tbrB   s       r6   rD   zDeviceContext.__exit__E   s     w'6::r5   c                 v    |xs i }|t               v r |j                  d      | j                  |d<    ||i |S )Nr;   )r7   getr;   )r<   functypesargskwargss        r6   __torch_function__z DeviceContext.__torch_function__J   sC    2'))fjj.B.J#{{F8T$V$$r5   )r4   N)__name__
__module____qualname__r=   rA   rD   rN   __classcell__)rB   s   @r6   r9   r9   ;   s    +#;
%r5   r9   c                 "     t         fd|      S )Nc                       S r
   r4   r;   s   r6   <lambda>z"device_decorator.<locals>.<lambda>R   s    V r5   r   )r;   rJ   s   ` r6   device_decoratorrW   Q   s    ^T22r5   c                       fdS )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                 B    t        t        j                        |       S r
   )rW   r   r;   )rJ   r;   s    r6   rV   zset_device.<locals>.<lambda>[   s    (f)=tD r5   r4   rU   s   `r6   
set_devicerZ   T   s     EDr5   )typingr   r   torch.overridesr   torch.utils._contextlibr   	functoolsr   r;   __annotations__	lru_cacher7   r9   rW   rZ   r4   r5   r6   <module>ra      s_      - 5 )-& -Q. .b%% %,3Er5   