~L i ddlmZddlmZddlmZmZddlmZ dgZ Gdde Z dD]Z ee e e fde e Zy ) )Iterable)Any)InvalidVersionVersion) __version__ TorchVersioncDeZdZdZdZdedefdZdededeffd Z xZ S) rabA 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' inpreturnct|tr|St|tr t|St|tr!tdj d|DSt |)N.c32K|]}t|ywN)str).0items Y/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/torch/torch_version.py z3TorchVersion._convert_to_version..,s#>$CI#>s) isinstancerrrjoinr)selfr s r_convert_to_versionz TorchVersion._convert_to_version sV c7 #J S !3<  X &388#>##>>? ? % %cmpmethodc tt|||j|S#t$r5}t |t stt ||cYd}~Sd}~wwxYwr)getattrrr BaseExceptionrrsuper)rrre __class__s r _cmp_wrapperzTorchVersion._cmp_wrapper0s` 11774=&1$2J2J32OP P 1a0,757F+C0 0  1s)- A+*A& A+&A+) __name__ __module__ __qualname____doc__ __slots__rrrboolr# __classcell__)r"s@rrr sA"I&s&s& 11S1T11r)__gt____lt____eq____ge____le__c&|j||Sr)r#)xyrs rr3?sq&(ArN)collections.abcrtypingrtorch._vendor.packaging.versionrr torch.versionrinternal_version__all__rr cmp_methodsetattrr rrr<s[$C9  -13-1`EJ &A+, r