o
    ôjE  ã                	   @   sî   d dl Z d dlZd dlZddlmZ dZdd„ ZzBe jdkrIejdk rIe j	d	 Z
e
 d
¡ZeD ]Ze j e¡rHze  e¡ W q/ eyG   Y q/w q/edƒZej e¡ dZdd„ ZW n eefye   Y nw dd„ Zdd„ Zdd„ Zeƒ  dS )é    Né   )Ú_get_extension_pathFc                   C   ó   dS )NF© r   r   r   úf/var/www/html/academy/tools/voices/clone/sv-venv/lib/python3.10/site-packages/torchvision/extension.pyÚ_has_ops   ó   r   Únt)é   é	   ÚPATHú;Ú_CTc                   C   r   )NTr   r   r   r   r   r   %   r   c                   C   s   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   r   Ú_assert_has_ops,   s
   ÿÿr   c               
   C   sÊ   t sdS ddlm}  tjj ¡ }|dkrc| durct|ƒ}t|ƒdk r/t|d ƒ}t|d ƒ}nt|dd… ƒ}t|d ƒ}|  	d¡}t|d ƒ}t|d	 ƒ}||krct
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ÚtorchvisionZ_cuda_versionÚstrÚintÚsplitr   )Ztorch_version_cudaÚ_versionZ
tv_versionZtv_majorZtv_minorÚ	t_versionZt_majorZt_minorr   r   r   Ú_check_cuda_version9   s6   
ÿÿþþÿr   c                 C   s   t | ƒ}tj |¡ d S )N)r   r   r   Úload_library)Úlib_nameÚlib_pathr   r   r   Ú_load_libraryW   s   r#   )ÚosÚsysr   Z_internally_replaced_utilsr   r   r   ÚnameÚversion_infoÚenvironZenv_pathr   Zpath_arrÚpathÚexistsÚadd_dll_directoryÚ	Exceptionr"   r   r    ÚImportErrorÚOSErrorr   r   r#   r   r   r   r   Ú<module>   s:    

ÿýÿ
