
    IЦi	                         S SK JrJr  S SKJrJr  S SKJr  S/r	 " S S\
5      rS H  r\" \\\4S j5        M     \" \5      rg)	    )AnyIterable)InvalidVersionVersion)__version__TorchVersionc                   N   ^  \ rS rSrSrS\S\4S jrS\S\S\4U 4S jjr	S	r
U =r$ )
r   
   a&  A string with magic powers to compare to both Version and iterables!
Prior to 1.10.0 torch.__version__ was stored as a str and so many did
comparisons against torch.__version__ as if it were a str. In order to not
break them we have TorchVersion which masquerades as a str while also
having the ability to compare against both packaging.version.Version as
well as tuples of values, eg. (1, 2, 1)
Examples:
    Comparing a TorchVersion object to a Version object
        TorchVersion('1.10.0a') > Version('1.10.0a')
    Comparing a TorchVersion object to a Tuple object
        TorchVersion('1.10.0a') > (1, 2)    # 1.2
        TorchVersion('1.10.0a') > (1, 2, 1) # 1.2.1
    Comparing a TorchVersion object against a string
        TorchVersion('1.10.0a') > '1.2'
        TorchVersion('1.10.0a') > '1.2.1'
inpreturnc                     [        U[        5      (       a  U$ [        U[        5      (       a  [        U5      $ [        U[        5      (       a!  [        SR	                  S U 5       5      5      $ [        U5      e)N.c              3   8   #    U  H  n[        U5      v   M     g 7fN)str).0items     R/var/www/html/ai-image-ml/venv/lib/python3.13/site-packages/torch/torch_version.py	<genexpr>3TorchVersion._convert_to_version.<locals>.<genexpr>)   s     #>#$CII#s   )
isinstancer   r   r   joinr   )selfr   s     r   _convert_to_version TorchVersion._convert_to_version   s_    c7##JS!!3<X&& 388#>##>>?? %%    cmpmethodc                    >  [        [        U 5      U5      " U R                  U5      5      $ ! [         a:  n[	        U[
        5      (       d  e [        [        5       U5      " U5      s S nA$ S nAff = fr   )getattrr   r   BaseExceptionr   r   super)r   r   r   e	__class__s       r   _cmp_wrapperTorchVersion._cmp_wrapper-   s_    	174=&1$2J2J32OPP 	1a00 57F+C00	1s   )- 
A1/A,&A1,A1 )__name__
__module____qualname____firstlineno____doc__r   r   r   boolr%   __static_attributes____classcell__)r$   s   @r   r   r   
   s:    $&s &s & 1 1S 1T 1 1r   )__gt____lt____eq____ge____le__c                 $    U R                  X5      $ r   )r%   )xyr   s      r   <lambda>r8   <   s    q(Ar   N)typingr   r   torch._vendor.packaging.versionr   r   torch.versionr   internal_version__all__r   r   
cmp_methodsetattrr'   r   r   <module>r@      sT      C 9 
+13 +1\ EJ&A E +,r   