
    ڧgE                        d dl Z d dlZd dlZddlmZ dZd Z	 e j        dk    riej        dk     r^e j	        d         Z
e
                    d	          ZeD ]9Ze j                            e          r	  e j        e           .# e$ r Y 5w xY w: ed
          Zej                            e           dZd Zn# eef$ r Y nw xY wd Zd Zd Z e             dS )    N   )_get_extension_pathFc                      dS )NF r       Q/var/www/html/ai-engine/env/lib/python3.11/site-packages/torchvision/extension.py_has_opsr	      s    5r   nt)   	   PATH;_CTc                      dS )NTr   r   r   r   r	   r	   %   s    tr   c                  @    t                      st          d          d S )Na  Couldn't load custom C++ ops. This can happen if your PyTorch and torchvision versions are incompatible, or if you had errors while compiling torchvision from source. For further information on the compatible versions, check https://github.com/pytorch/vision#installation for the compatibility matrix. Please check your PyTorch version with torch.__version__ and your torchvision version with torchvision.__version__ and verify if they are compatible, and if not please reinstall torchvision so that it matches your PyTorch install.)r	   RuntimeErrorr   r   r   _assert_has_opsr   ,   s0    :: 	
T
 
 	
	
 	
r   c                  .   t           sdS ddlm}  t          j        j                                        }|dk    r| t          |          }t          |          dk     r+t          |d                   }t          |d                   }n,t          |dd                   }t          |d                   }| 	                    d          }t          |d                   }t          |d	                   }||k    rt          d
| d| d| d| d	          |S )z`
    Make sure that CUDA versions match between the pytorch install and torchvision install
    r   )cudaNi'     r   .r   zqDetected that PyTorch and torchvision were compiled with different CUDA major versions. PyTorch has CUDA Version=z" and torchvision has CUDA Version=zE. Please reinstall the torchvision that matches your PyTorch install.)_HAS_OPStorch.versionr   torchopstorchvision_cuda_versionstrintsplitr   )torch_version_cuda_version
tv_versiontv_majortv_minor	t_versiont_majort_minors           r   _check_cuda_versionr*   9   sO     r888888y$2244H2~~,8]]
z??U"":a=))H:a=))HH:ac?++H:a=))H&,,S11	il##il##hV,3V V6=V V (V V+3V V V   Or   c                 b    t          |           }t          j                            |           d S )N)r   r   r   load_library)lib_namelib_paths     r   _load_libraryr/   W   s+    "8,,H	I8$$$$$r   )ossysr   _internally_replaced_utilsr   r   r	   nameversion_infoenvironenv_pathr!   path_arrpathexistsadd_dll_directory	Exceptionr.   r   r,   ImportErrorOSErrorr   r*   r/   r   r   r   <module>r>      s   				 



  ; ; ; ; ; ;   	 
w$3+f44:f%>>#&& 	 	Dw~~d## (B(....    D #"4((H	I8$$$H    	W 	 	 	D	

 

 

  <% % %
       s6   AB8 0B B8 B	B8 B		.B8 8CC