ó
    !Eñih  ã                   ó2  • S SK Jr  S SKJrJrJr  S SKJr  S SKrS SK	J
r
Jr  / SQr\" S\S9S	\S
\4S j5       rS	\S
\4S jr\" S\\\5      r\ SS\R*                  S\\\R.                  -     S\S
\\R*                  S4   4S jj5       r\ SS\S\\\R.                  -     S\S
\\   4S jj5       rSS jr SS\\S4   S\\\4   S-  S\\\R.                  -     S\S
\\\S4   \\\\4   S4   4   4
S jjrSS\S\\R.                  -  S\S
\4S jjrg)é    )ÚSequence)ÚAnyÚoverloadÚTypeVar)Ú
deprecatedN)ÚGatherÚScatter)ÚscatterÚscatter_kwargsÚgatherzC`is_namedtuple` is deprecated, please use the python checks instead)ÚcategoryÚobjÚreturnc                 ó   • [        U 5      $ ©N)Ú_is_namedtuple©r   s    Ú]/home/mande/repo/quber/.venv/lib/python3.13/site-packages/torch/nn/parallel/scatter_gather.pyÚis_namedtupler      s   € ô ˜#ÓÐó    c                 ón   • [        U [        5      =(       a    [        U S5      =(       a    [        U S5      $ )NÚ_asdictÚ_fields)Ú
isinstanceÚtupleÚhasattrr   s    r   r   r      s+   € ô 	�3œÓ×V¤7¨3°	Ó#:×V¼wÀsÈIÓ?Vðr   ÚT.ÚinputsÚtarget_gpusÚdimc                 ó   • g r   © ©r   r   r    s      r   r
   r
   !   s   € ð
  #r   c                 ó   • g r   r"   r#   s      r   r
   r
   )   s   € ð
 r   c                 ó@   ^^^• UUU4S jm T" U 5      nSmU$ ! Smf = f)zŽSlice tensors into approximately equal chunks and distributes them across given GPUs.

Duplicates references to objects that are not tensors.
c                 ó<  >• [        U [        R                  5      (       a  [        R                  " TS TU 5      $ [        U 5      (       a2  [        [        TU 5      SS06 Vs/ s H  n[        U 5      " U6 PM     sn$ [        U [        5      (       a-  [        U 5      S:”  a  [        [        [        TU 5      SS065      $ [        U [        5      (       a>  [        U 5      S:”  a/  [        [        TU 5      SS06 Vs/ s H  n[        U5      PM     sn$ [        U [        5      (       aR  [        U 5      S:”  aC  [        [        TU R                  5       5      SS06 Vs/ s H  n[        U 5      " U5      PM     sn$ T Vs/ s H  o0PM     sn$ s  snf s  snf s  snf s  snf )NÚstrictFr   )r   ÚtorchÚTensorr	   Úapplyr   ÚzipÚmapÚtyper   ÚlenÚlistÚdictÚitems)r   ÚargsÚiÚ_r    Úscatter_mapr   s       €€€r   r5   Úscatter.<locals>.scatter_map7   sr  ø€ Ü�cœ5Ÿ<™<×(Ñ(Ü—=’= ¨d°C¸Ó=Ð=Ü˜#×Ñô  ¤ [°#Ó!6ÐE¸uÒEóò F�Dô �S”	˜4Ó áEñð ô
 �cœ5×!Ñ!¤c¨#£h°£läœœS ¨cÓ2ÐA¸5ÑAÓBÐBÜ�cœ4× Ñ ¤S¨£X°£\ä%(¬#¨k¸3Ó*?Ð%NÈÒ%NÓOÒ%N ”D˜–GÑ%NÑOÐOÜ�cœ4× Ñ ¤S¨£X°£\ô œc +¨s¯y©y«{Ó;ÐJÀEÒJóò K�Aô �S”	˜!–áJñð ñ
 )Ó)š[˜’™[Ñ)Ð)ùò#ùò Pùòùò
 *s   Á!F
Ã9FÅFÅ<FNr"   )r   r   r    Úresr5   s    `` @r   r
   r
   1   s*   ú€ ÷*ð8Ù˜&Ó!ˆàˆØ€Jøð ‰úó   � ™Úkwargsc           	      ó¼  • U (       a  [        XU5      O/ nU(       a  [        XU5      O/ n[        U5      [        U5      :  a7  UR                  S [        [        U5      [        U5      -
  5       5       5        ON[        U5      [        U 5      :  a6  UR                  S [        [        U5      [        U5      -
  5       5       5        [	        U5      [	        U5      4$ )z+Scatter with support for kwargs dictionary.c              3   ó&   #   • U  H  nS v •  M	     g7f)r"   Nr"   ©Ú.0r4   s     r   Ú	<genexpr>Ú!scatter_kwargs.<locals>.<genexpr>d   ó   é € ð  
ÚL�1�BÒLùó   ‚c              3   ó&   #   • U  H  n0 v •  M	     g 7fr   r"   r<   s     r   r>   r?   h   r@   rA   )r
   r.   ÚextendÚranger   )r   r9   r   r    Úscattered_inputsÚscattered_kwargss         r   r   r   Z   sÊ   € ö =C”w˜v°CÔ8ÈÐÞ<B”w˜v°CÔ8ÈÐÜ
ÐÓœsÐ#3Ó4Ó4Ø×Ññ  
ÜœcÐ"2Ó3´cÐ:JÓ6KÑKÔLó 
õ 	
ô 
ÐÓ	¤ V£Ó	,Ø×Ññ  
ÜœcÐ"2Ó3´cÐ:JÓ6KÑKÔLó 
ô 	
ô Ð!Ó"¤EÐ*:Ó$;Ð;Ð;r   ÚoutputsÚtarget_devicec                 ó@   ^^^• UUU4S jm T" U 5      nSmU$ ! Smf = f)am  Gather tensors from different GPUs on a specified device.

This function is useful for gathering the results of a distributed computation.
It takes a sequence of objects, one for each GPU, and returns a single object
on the specified device.

Args:
    outputs (Any): A sequence of objects (potentially tensors) to gather.
    target_device (Union[int, torch.device]): The device to gather the tensors to.
        Use 'cpu' for CPU to avoid a deprecation warning.
    dim (int, optional): The dimension along which to gather. Default: 0.

Returns:
    Any: A gathered object (potentially tensor) on the specified device.
c           
      óö  >^ ^• T S   m[        T[        R                  5      (       a  [        R                  " TT/T Q76 $ Tc  g [        T[
        5      (       aA  [        U4S jT  5       5      (       d  [        S5      e[        T5      " UU 4S jT 5       5      $ [        T5      (       a-  [        T5      R                  [        T[        T SS065      5      $ [        T5      " [        T[        T SS065      5      $ )Nr   c              3   óR   >#   • U  H  n[        T5      [        U5      :H  v •  M     g 7fr   )r.   )r=   ÚdÚouts     €r   r>   Ú-gather.<locals>.gather_map.<locals>.<genexpr>†   s   øé € Ð;²7¨a”s˜3“x¤3 q£6Ö)²7ùs   ƒ$'z+All dicts must have the same number of keysc           	   3   óf   >#   • U  H!  oT" T Vs/ s H  o"U   PM	     sn5      4v •  M#     g s  snf 7fr   r"   )r=   ÚkrL   Ú
gather_maprG   s      €€r   r>   rN   ‰   s-   øé € ÐSÊsÈ!¡¹7Ó,Cº7°a¨q¬T¹7Ñ,CÓ!DÕEÊsùÒ,Cùs   ƒ1�,�1r'   T)r   r(   r)   r   r*   r0   ÚallÚ
ValueErrorr-   r   Ú_maker,   r+   )rG   rM   r    rQ   rH   s   `@€€€r   rQ   Úgather.<locals>.gather_map   sÉ   ú€ Ø�a‰jˆÜ�cœ5Ÿ<™<×(Ñ(Ü—<’< ¨sÐ=°WÒ=Ð=Ø‰;ØÜ�cœ4× Ñ ÜÔ;±7Ó;×;Ñ;Ü Ð!NÓOÐOä˜”9ÕSÉsÓSÓSÐSÜ˜#×Ñä˜“9—?‘?¤3 z´3¸Ð3MÈÑ3MÓ#NÓOÐOä�CŒyœ˜Z¬¨gÐ)C¸dÑ)CÓDÓEÐEr   Nr"   )rG   rH   r    r7   rQ   s    `` @r   r   r   n   s+   ú€ ÷"Fð&Ù˜Ó!ˆàˆ
Ø€Jøð ‰
úr8   ).)r   )Úcollections.abcr   Útypingr   r   r   Útyping_extensionsr   r(   Útorch.nn.parallel._functionsr   r	   Ú__all__ÚFutureWarningÚboolr   r   r0   r/   r   r   r)   ÚintÚdevicer
   Ústrr   r   r"   r   r   Ú<module>r`      sË  ðå $ß )Ñ )Ý (ã ß 8ò 2€ñ ØIØñð�sð ˜tó ó	ðð
˜ð  ô ñ ˆC��t˜UÓ#€ð 
ð ñ#Ø�L‰Lð#à˜# §¡Ñ,Ñ-ð#ð 
ð#ð ˆ5�<‰<˜ÐÑô	#ó 
ð#ð 
ð ñØðà˜# §¡Ñ,Ñ-ðð 
ðð 
ˆ!�Wô	ó 
ðô&ðZ ñ	<Ø�#�s�(‰Oð<à��c�‰N˜TÑ!ð<ð ˜# §¡Ñ,Ñ-ð<ð 
ð	<ð
 ˆ5��c�‰?˜E $ s¨C x¡.°#Ð"5Ñ6Ð6Ñ7õ<ñ((�Cð (¨¨e¯l©lÑ(:ð (Àð (ÈSö (r   