
    rh{	                     t   U d dl mZ d dlmZ d dlZd dlmZ d dlmZ dee	   fdZ
dee	   fdZeeee         Zeed	<   ee   Zeed
<   ej
                  gZ e       	 ddededeeej(                  ej*                  f   eeef   f   fd       Zdej(                  defdZdee   dej(                  defdZy)    )Optional)	TypeAliasN)Tensor)no_gradreturnc                  D    ddt         j                  j                         gS )z:Return the device type list that supports foreach kernels.cudaxputorch_C_get_privateuse1_backend_name     m/var/www/html/ai-insurance-compliance-backend/venv/lib/python3.12/site-packages/torch/utils/_foreach_utils.py&_get_foreach_kernels_supported_devicesr   	   s    E588AACDDr   c                  J    dddddt         j                  j                         gS )zEReturn the device type list that supports fused kernels in optimizer.mpsr	   r
   hpucpur   r   r   r   $_get_fused_kernels_supported_devicesr      s-     	..0 r   TensorListListIndicestensorlistlistwith_indicesc                 B    t         j                  j                  | |      S N)r   r   "_group_tensors_by_device_and_dtype)r   r   s     r   r   r   *   s    
 8866~|TTr   devicec                 x    | j                   t               dgz   v xr t        j                  j	                          S )Nr   )typer   r   jitis_scripting)r   s    r   _device_has_foreach_supportr$   2   s6    >@E7JK 	)		&&((r   tensorsc                 @    t        |      xr t        d | D              S )Nc              3   J   K   | ]  }|d u xs t        |      t        v   y wr   )r!   _foreach_supported_types).0ts     r   	<genexpr>z'_has_foreach_support.<locals>.<genexpr>:   s+      7=>T	8T!W 8887s   !#)r$   all)r%   r   s     r   _has_foreach_supportr-   9   s(    &v. 3 7BI7 4 r   )F)typingr   typing_extensionsr   r   r   torch.autograd.grad_moder   liststrr   r   r   __annotations__intr   r(   booldicttupler   dtyper   r$   r-   r   r   r   <module>r9      s    '   ,ES	 E
	d3i 	 !hv&6!78	 8#Y !LL>  	 U"UU 
%ekk)
*E.'2I,J
JKU U  $v,   r   