+
    ùäûjì  ã                   óà   € ^ RI Ht ^ RIHtHtHtHtHt ^ RIH	t	 ^ RI
Ht ^ RIHt ]! R4      t]]]R3,          ]],          3,          t]! ^€R7      R	 R
 l4       tR R ltR R ltR R ltR# )é    )Ú	lru_cache)ÚListÚSequenceÚTupleÚTypeVarÚUnion)ÚEinopsError)Úget_backend)ÚParsedExpressionÚTensor.)Úmaxsizec          	      óh   € V ^8„  d   QhR\         R\         R\        \        \        \        3,          /# )é   ÚpatternÚopnameÚreturn)Ústrr   Úint)Úformats   "ÚJC:\Ai_Coding\apps\studio\ComfyUI\.venv\Lib\site-packages\einops\packing.pyÚ__annotate__r      s,   € ÷ 1ñ 1œSð 1¬#ð 1´%¼¼SÄ#¸Õ2Fñ 1ó    c           
      óº  € V P                  4       p\        V4      p\        V4      \        V4      8w  d   \        R V RV  R24      hRV9  d   \        RV RV  R24      hV FA  pVR8w  g   K  \        P
                  ! V4      w  rVV'       d   K.  \        RV RV RV  R24      h	  VP                  R4      p\        V4      V,
          ^,
          pWx,           p	WxV	3# )zDuplicates in axes names in z(..., "z")Ú*zNo *-axis in zInvalid axis name z in )ÚsplitÚsetÚlenr	   r   Úcheck_axis_name_return_reasonÚindex)
r   r   ÚaxesÚaxes_setÚaxisÚis_validÚreasonÚn_axes_beforeÚn_axes_afterÚmin_axess
   &&        r   Úanalyze_patternr(      sç   € ð �=‰=‹?€DÜ�4‹y€HÜ
ˆ4ƒy”C˜“MÔ!ÜÐ8¸¸ÀÈÀyÐPRÐSÓTÐTØ
�(ÔÜ˜M¨&¨°¸¸	ÀÐDÓEÐEÛˆØ�3Ž;Ü/×MÒMÈdÓSÑˆHß‘8Ü!Ð$6°t°f¸DÀÀÈÐPWÈyÐXZÐ"[Ó\Ð\ñ	 ð
 —J‘J˜s“O€MÜ�t“9˜}Õ,¨qÕ0€LØÕ+€HØ¨Ð0Ð0r   c          	      óŠ   € V ^8„  d   QhR\         \        ,          R\        R\        \        \        \
        ,          3,          /# )r   Útensorsr   r   )r   r   r   r   r   ÚShape)r   s   "r   r   r   !   s9   € ÷ 6Oñ 6O”(œ6Õ"ð 6O¬Sð 6O´U¼6Ä4ÌÅ;Ð;NÕ5Oñ 6Or   c                ó²  € \        VR4      w  r#p\        V ^ ,          4      p. p. p\        V 4       F�  w  r‰VP                  V	4      p
\	        V
4      V8  d   \        RV RV
 RV RV R2	4      h\	        V
4      V,
          pVP                  W¢V 4       VP                  VP                  V	. V
RV OR	NW«R O54      4       K’  	  VP                  WbR7      V3# )
a©  
Packs several tensors into one.
See einops tutorial for introduction into packing (and how it replaces stack and concatenation).

Parameters:
    tensors: tensors to be packed, can be of different dimensionality
    pattern: pattern that is shared for all inputs and output, e.g. "i j * k" or "batch seq *"

Returns:
    (packed_tensor, packed_shapes aka PS)

Example:
```python
>>> from numpy import zeros as Z
>>> inputs = [Z([2, 3, 5]), Z([2, 3, 7, 5]), Z([2, 3, 7, 9, 5])]
>>> packed, ps = pack(inputs, 'i j * k')
>>> packed.shape, ps
((2, 3, 71, 5), [(), (7,), (7, 9)])
```

In this example, axes were matched to: i=2, j=3, k=5 based on order (first, second, and last).
All other axes were 'packed' and concatenated.
PS (packed shapes) contains information about axes that were matched to '*' in every input.
Resulting tensor has as many elements as all inputs in total.

Packing can be reversed with unpack, which additionally needs PS (packed shapes) to reconstruct order.

```python
>>> inputs_unpacked = unpack(packed, ps, 'i j * k')
>>> [x.shape for x in inputs_unpacked]
[(2, 3, 5), (2, 3, 7, 5), (2, 3, 7, 9, 5)]
```

Read the tutorial for introduction and application scenarios.
Úpackzpacked tensor #z' (enumeration starts with 0) has shape z, while pattern z assumes at least z axesN)r"   éÿÿÿÿ)	r(   r
   Ú	enumerateÚshaper   r	   ÚappendÚreshapeÚconcat)r*   r   r%   r&   r'   ÚbackendÚreshaped_tensorsÚpacked_shapesÚiÚtensorr0   Úaxis_after_packed_axess   &&          r   r-   r-   !   s  € ôH -<¸GÀVÓ,LÑ)€M ô ˜' !�*Ó%€Gà%'ÐØ!#€MÜ˜wÖ'‰	ˆØ—‘˜fÓ%ˆÜˆu‹:˜Ô ÜØ! ! Ð$KÈEÈ7ð S!Ø!( 	Ð);¸H¸:ÀUðLóð ô "% U£¨lÕ!:ÐØ×Ñ˜UÐ1GÐHÔIØ×Ñ §¡°Ð8u¸%ÀÀÐ:OÐ8uÐQSÐ8uÐV[Ð\sÐVtÑ8uÓ vÖwñ (ð �>‰>Ð*ˆ>Ó?ÀÐNÐNr   c                ó0   € V ^8„  d   QhR\         R\        /# )r   Úxr   )r+   r   )r   s   "r   r   r   Z   s   € ÷ ñ ŒEð ”cñ r   c                 ó,   € ^pV  F  pW,          pK  	  V# )é   © )r;   Úresultr7   s   &  r   Úprodr@   Z   s   € Ø€FÛˆØ�Šñ à€Mr   c          	      ót   € V ^8„  d   QhR\         R\        \        ,          R\        R\        \         ,          /# )r   r8   r6   r   r   )r   r   r+   r   )r   s   "r   r   r   a   s6   € ÷ \ñ \”6ð \¬$¬u­+ð \Äð \ÌÌVÍñ \r   c                ó¤  € \        VRR7      w  r4p\        V 4      pVP                  V 4      p\        V4      V^,           V,           8w  d   \	        RV RV 24      hTpV U	u. uF  p	RV	9   d   RM
\        V	4      NK  	  p
p	\        R V
 4       4      pV^8”  d   \	        RV RV R24      h^ .\        V4      ,          Wx,          .,           pV^ 8X  d1   \        V
RR 4       F  w  rÞWÍ,          V,           WÍ^,           &   K  	  M�V
P                  R4      p\        V4       F!  pWÍ,          W­,          ,           WÍ^,           &   K#  	  \        V^,           \        V
4      4      RRR1,           F$  pVV^,           ,          V
V,          ,
          VV&   K&  	  VRV pWx^,           R p\        RR4      3V,          p \        V4       UUu. uFH  w  ppVP                  V . VO\        WÍ,          WÍ^,           ,          4      N5,          . VOVOVO54      NKJ  	  upp# u up	i u uppi   \         d"   p\	        R	T R
TR,           RT 24      ThRp?ii ; i)a¼  
Unpacks a single tensor into several by splitting over a selected axes.
See einops tutorial for introduction into packing (and how it replaces stack and concatenation).

Parameters:
    tensor: tensor to be unpacked
    packed_shapes: packed_shapes (aka PS) is a list of shapes that take place of '*' in each output.
        output will contain a single tensor for every provided shape
    pattern: pattern that is shared for input and all outputs, e.g. "i j * k" or "batch seq *",
        where * designates an axis to be unpacked

Returns:
    list of tensors

If framework supports views, results are views to the original tensor.

Example:
```python
>>> from numpy import zeros as Z
>>> inputs = [Z([2, 3, 5]), Z([2, 3, 7, 5]), Z([2, 3, 7, 9, 5])]
>>> packed, ps = pack(inputs, 'i j * k')
>>> packed.shape, ps
((2, 3, 71, 5), [(), (7,), (7, 9)])
```

In this example, axes were matched to: i=2, j=3, k=5 based on order (first, second, and last).
All other axes were 'packed' and concatenated.
PS (packed shapes) contains information about axes that were matched to '*' in every input.
Resulting tensor has as many elements as all inputs in total.

Packing can be reversed with unpack, which additionally needs PS (packed shapes) to reconstruct order.

```python
>>> inputs_unpacked = unpack(packed, ps, 'i j * k')
>>> [x.shape for x in inputs_unpacked]
[(2, 3, 5), (2, 3, 7, 5), (2, 3, 7, 9, 5)]
```

Read the tutorial for introduction and application scenarios.
Úunpack)r   zunpack(..., z)) received input of wrong dim with shape c              3   ó>   "  € T F  p\        VR8H  4      x € K  	  R# 5i)r=   Nr.   )r   )Ú.0r;   s   & r   Ú	<genexpr>Úunpack.<locals>.<genexpr>•   s   é € Ð!QÑ8P°1¤# a¨2¡g§, ,Ó8Pùs   ‚z) received more than one -1 in z and can't infer dimensionsNzError during unpack(..., "z!"): could not split axis of size z into requested r.   )r(   r
   r0   r   r	   r@   Úsumr/   r   ÚrangeÚslicer2   Ú	Exception)r8   r6   r   r%   r&   r'   r4   Úinput_shapeÚunpacked_axisÚp_shapeÚlengths_of_composed_axesÚn_unknown_composed_axesÚsplit_positionsr7   r;   Úunknown_composed_axisÚjÚshape_startÚ	shape_endÚslice_fillerÚelement_shapeÚes   &&&                   r   rC   rC   a   sš  € ôR -<¸GÈHÔ,UÑ)€M ä˜&Ó!€GØ—-‘- Ó'€KÜ
ˆ;Ó˜=¨1Õ,¨|Õ;Ô;Ü˜L¨¨	Ð1ZÐ[fÐZgÐhÓiÐià&€MáanÓ*oÑanÐV]°°w´©2ÄDÈÃMÒ+QÑanÐÐ*oä!Ñ!QÑ8PÓ!QÓQÐØ Ô"ÜØ˜7˜)Ð#BÀ=À/ÐQlÐmó
ð 	
ð �cœC Ó.Õ.°+Õ2LÐ1MÕM€OØ !Ô#ÜÐ6°s¸Ð;Ö<‰DˆAØ%4Õ%7¸!Õ%;ˆO �EÓ"ò =ð &>×%CÑ%CÀBÓ%GÐÜÐ,Ö-ˆAØ%4Õ%7Ð:RÕ:UÕ%UˆO �EÓ"ñ .äÐ,¨qÕ0´#Ð6NÓ2OÓPÑQUÐSUÐQU×VÐVˆAØ!0°°QµÕ!7Ð:RÐSTÕ:UÕ!UˆO˜AÓñ Wð ˜n˜}Ð-€KØ¨AÕ-Ð/Ð0€IÜ˜$ Ó%Ð'¨-Õ7€Lðô %.¨mÔ$<ô
ñ %=Ñ ��=ð �O‰OàÐY˜ÐY¤u¨_Õ-?ÀÐUVÕQVÕAWÓ'XÑYÕZØ:�+Ð: Ð:°	Ñ:öñ
 %=ò
ð 	
ùò; +pùó:
øô ô äØ(¨¨	Ð1RÐSbÐceÕSfÐRgØ˜}˜oð/ó
ð ð	ûðús1   Á"HÆ8H# ÇAHÈH# ÈH# È#IÈ.I
É
IN)Ú	functoolsr   Útypingr   r   r   r   r   Úeinopsr	   Úeinops._backendsr
   Úeinops.parsingr   r   r   r+   r(   r-   r@   rC   r>   r   r   Ú<module>r^      sg   ðÝ ß 8Õ 8å Ý (Ý +á	�Ó	€àˆe�C˜�H�o˜t C�yÐ(Õ)€ñ �3Ôô1ó ð1õ&6Oõr÷\r   