
    Ph
                         d dl Z d dlmZ d dlmZ d dlZda ej                  d      d        Z G d de      Z	d Z
d	 Zy)
    N)TorchFunctionModecontext_decorator   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     ^C:\Users\daisl\Desktop\realtime-object-detection\venv\Lib\site-packages\torch/utils/_device.py_device_constructorsr5      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- -r3   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)selfr9   s     r4   __init__zDeviceContext.__init__;   s    ll6*r3   c                 N    t         | _        | j                  a t        |          S r   )CURRENT_DEVICE
old_devicer9   super	__enter__)r:   	__class__s    r4   r@   zDeviceContext.__enter__>   s!    (w ""r3   c                 >    | j                   at        |   |||      S r   )r>   r=   r?   __exit__)r:   exc_typeexc_valexc_tbrA   s       r4   rC   zDeviceContext.__exit__D   s     w'6::r3   c                 v    |xs i }|t               v r |j                  d      | j                  |d<    ||i |S )Nr9   )r5   getr9   )r:   functypesargskwargss        r4   __torch_function__z DeviceContext.__torch_function__I   sC    2'))fjj.B.J#{{F8T$V$$r3   )r2   N)__name__
__module____qualname__r;   r@   rC   rM   __classcell__)rA   s   @r4   r7   r7   :   s    +#;
%r3   r7   c                 "     t         fd|      S )Nc                       S r   r2   r9   s   r4   <lambda>z"device_decorator.<locals>.<lambda>Q   s    Vr3   r   )r9   rI   s   ` r4   device_decoratorrV   P   s    ^T22r3   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   )rV   r	   r9   )rI   r9   s    r4   rU   zset_device.<locals>.<lambda>Z   s    (f)=tDr3   r2   rT   s   `r4   
set_devicerY   S   s     EDr3   )r	   torch.overridesr   torch.utils._contextlibr   	functoolsr=   	lru_cacher5   r7   rV   rY   r2   r3   r4   <module>r^      sN     - 5 Q. .b%% %,3Er3   