
    קg	                         d dl mZmZ d dlmZmZ d dlmZ dgZ	 G d de
          ZdD ]Z eeeefd            ee          ZdS )	    )AnyIterable)InvalidVersionVersion)__version__TorchVersionc                   @     e Zd ZdZdedefdZdededef fdZ xZ	S )r   ab  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                    t          |t                    r|S t          |t                    rt          |          S t          |t                    r,t          d                    d |D                                 S t          |          )N.c              3   4   K   | ]}t          |          V  d S N)str).0items     O/var/www/html/ai-engine/env/lib/python3.11/site-packages/torch/torch_version.py	<genexpr>z3TorchVersion._convert_to_version.<locals>.<genexpr>)   s(      #>#>$CII#>#>#>#>#>#>    )
isinstancer   r   r   joinr   )selfr
   s     r   _convert_to_versionz TorchVersion._convert_to_version   s    c7## 	&JS!! 	&3<<X&& 		& 388#>#>##>#>#>>>??? %%%r   cmpmethodc                    	  t          t          |           |          |                     |                    S # t          $ rE}t	          |t
                    s  t          t                      |          |          cY d }~S d }~ww xY wr   )getattrr   r   BaseExceptionr   r   super)r   r   r   e	__class__s       r   _cmp_wrapperzTorchVersion._cmp_wrapper-   s    	11774==&11$2J2J32O2OPPP 	1 	1 	1a00  ,7577F++C00000000	1s   8< 
B:B BB)
__name__
__module____qualname____doc__r   r   r   boolr"   __classcell__)r!   s   @r   r   r   
   s~         $&s &s & & & & 1 1S 1T 1 1 1 1 1 1 1 1 1 1r   )__gt____lt____eq____ge____le__c                 .    |                      ||          S r   )r"   )xyr   s      r   <lambda>r1   <   s    q&(A(A r   N)typingr   r   torch._vendor.packaging.versionr   r   torch.versionr   internal_version__all__r   r   
cmp_methodsetattr r   r   <module>r:      s                    C C C C C C C C 9 9 9 9 9 9 
+1 +1 +1 +1 +13 +1 +1 +1\ E  JG&AAA    l+,,r   