
    /j
                     j    d dl Z d dlZddlmZ d Zd Z ed          rd Zd Zd	 Z e             dS )
    N   )_get_extension_pathc           	      H   	 t          |           }t          j                            |           dS # t          t
          f$ r^}t          j                            d          r4ddl	}|
                    d|  dt          |          j         d|            Y d}~dS d}~ww xY w)	zLoad a library, optionally warning on failure based on env variable.

    Returns True if the library was loaded successfully, False otherwise.
    T-TORCHVISION_WARN_WHEN_EXTENSION_LOADING_FAILSr   NzFailed to load 'z' extension: z: F)r   torchopsload_libraryImportErrorOSErrorosenvirongetwarningswarntype__name__)lib_namelib_pather   s       Z/home/longshao/multi-rider-rag/.venv/lib/python3.11/site-packages/torchvision/extension.py_load_libraryr      s    
	&x00	x(((t!   :>>IJJ 	]OOOMM[X[[DGGDT[[XY[[\\\uuuuus   .2 B!ABB!c                      dS )NF r       r   _has_opsr      s    5r   _Cc                      dS )NTr   r   r   r   r   r      s    tr   c                  @    t                      st          d          d S )Nag  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. Set TORCHVISION_WARN_WHEN_EXTENSION_LOADING_FAILS=1 and retry to get more details.)r   RuntimeErrorr   r   r   _assert_has_opsr    #   s0    :: 

a	
 	
 		


 

r   c                     t                      sdS ddlm}  t          j        j                                        }|dk    r| t          |          }t          |          dk    sJ d| d            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.  zUnexpected CUDA version z, please file a bug report.      .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.)r   torch.versionr#   r   r   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_versionr5   1   sI    :: r888888y$2244H2~~,8]]
:%''')iH)i)i)i'''z!A#''z!}%%&,,S11	il##il##hV,3V V6=V V (V V+3V V V   Or   )r   r   _internally_replaced_utilsr   r   r   r    r5   r   r   r   <module>r7      s    				  ; ; ; ; ; ;  "   =   
 
 
  6       r   