+
    þäûj—w  ã                   óÎ  a € R[ tK0 t ^ RIHt ^ RIHtHtHtHtHtH	t	H
t
HtHt ^ RIt^ RIHu Ht ^ RIHtHt ^ RIHt ^ RIHtHt ^ RIHtHt ^ RIHtHt ^ R	I H!t!H"t" R
 R lt#R R lt$R R lt%R R lt&R R lt'R R lt(R R lt)R R lt*R R lt+R R lt,R R lt-R  R! lt.R\R" R# llt/R\R$ R% llt0R&t1R't2R( R) lt3R* R+ lt4R, R- lt5R. R/ lt6R0R/R1 R2 llt7R]R3 R4 llt8R5 R6 lt9R^R7 R8 llt:R9 R: lt;R^R; R< llt<R^R= R> llt=R^R? R@ llt>RA RB lt?RC RD lt@R_RE RF lltARG RH ltBRI RJ ltC ! RK RL4      tDRM RN ltERO RP ltFRQ RR ltGRSRT RURV RWRX /tH] ^ k R`tIRaRY RZ lltJR# )bé    ©Úwraps)	ÚAnyÚCallableÚDictÚListÚNoReturnÚOptionalÚSequenceÚTupleÚUnionN)ÚBetaÚUniform)ÚInputRankError)Ú_constant_tensorÚ_flatten_constant)Ú_extract_device_dtypeÚ_to_device_nonblocking)ÚBoxesÚ
VideoBoxes)Ú	KeypointsÚVideoKeypointsc                ó\   € V ^8„  d   QhR\         R\        \        \        ,          ,          /# ©é   ÚvalueÚreturn)r   r
   r   Úfloat)Úformats   "Ú]C:\Ai_Coding\apps\studio\ComfyUI\.venv\Lib\site-packages\kornia\augmentation\utils\helpers.pyÚ__annotate__r!   !   s#   € ÷ ñ œ#ð ¤(¬4´­;Õ"7ñ ó    c                ón  € \        V \        \        34      '       d#   \        V \        4      '       g   \        V 4      .# \        V \        \
        34      '       dV   \        ;QJ d    R V  4       F  '       d   K   RM	  RM! R V  4       4      '       d   V  Uu. uF  p\        V4      NK  	  up# R# u upi )zcReturn a Python number or a sequence of numbers as a list of floats, or ``None`` for anything else.c              3   óˆ   "  € T F8  p\        V\        \        34      ;'       d    \        V\        4      '       * x € K:  	  R # 5i©N)Ú
isinstanceÚintr   Úbool)Ú.0Úvs   & r    Ú	<genexpr>Ú!_float_numbers.<locals>.<genexpr>%   s6   é € Ð/wÑqvÐlm´
¸1¼sÄE¸lÓ0K×0gÐ0gÔT^Ð_`ÔbfÓTgÔPgÔ0gÓqvùs
   ‚!A¤AFTN)r&   r'   r   r(   ÚtupleÚlistÚall)r   r*   s   & r    Ú_float_numbersr0   !   s   € ä�%œ#œu˜×&Ò&¬z¸%Ä×/FÒ/FÜ�e“ˆ~ÐÜ�%œ%¤˜×'Ò'¯C«CÑ/wÑqvÓ/w¯C¯CªCÑ/wÑqvÓ/w×,wÒ,wÙ"'Ó(¡%˜Q”�a–¡%Ñ(Ð(Ùùò )s   ÂB2c                óˆ   € V ^8„  d   QhR\         R\        \        \        ,          ,          R\        P
                  R\         /# )r   ÚstoredÚnumbersÚdevicer   )r   r
   r   r   Útorchr4   )r   s   "r    r!   r!   *   s<   € ÷ Dñ Dœcð D¬H´T¼%µ[Õ,Að DÌ5Ï<É<ð DÔ\_ñ Dr"   c                óì  € Ve7   \        V \        P                  4      '       d   V P                  4       '       g   V # V P	                  4       \        V4      8w  d   V # V P                  V4      p \        P                  ! V4      P                  W P                  R7      P                  V P                  4      p\        P                  ! V\        P                  VR7      P                  V P                  4      pV P                  \        P                  4      p\        P                  ! \        P                  ! V4      WUP                  4       ,
          R4      p\        P                  ! W8H  WF,           V4      # )a†  Return ``stored`` in float64 on ``device``, with the numbers it was built from wherever it still holds them.

A Python number kept in a float32 tensor is rounded to float32; a float64 input uses the number itself. A value
changed after construction, by assignment or in place, is used as it is, and anything but a floating tensor is
returned unchanged. A gradient still reaches ``stored``.
©r4   Údtype)r8   r4   ç        )r&   r5   ÚTensorÚis_floating_pointÚnumelÚlenÚtoÚtensorr8   ÚreshapeÚshapeÚfloat64ÚwhereÚisfiniteÚdetach)r2   r3   r4   ÚbuiltÚexactÚstored64Úresiduals   &&&    r    Ú_exact_in_float64rJ   *   sú   € ð ‚œj¨´·±×>Ò>Àf×F^ÑF^×F`ÒF`ØˆØ‡|�|ƒ~œ˜W›Ô%ØˆØ�Y‰Y�vÓ€FÜ�LŠL˜Ó!×$Ñ$¨F¿,¹,Ð$ÓG×OÑOÐPV×P\ÑP\Ó]€EÜ�LŠL˜¬¯©¸fÔE×MÑMÈfÏlÉlÓ[€EØ�y‰yœŸ™Ó'€Hô �{Š{œ5Ÿ>š>¨(Ó3°XÇÁÓ@QÕ5QÐSVÓW€HÜ�;Š;�v‘¨Õ(8¸(ÓCÐCr"   c          
      óÊ   € V ^8„  d   QhR\         P                  R\        \        ,          R\        \
        \        \
        ,          3,          R\        R\         P                  /# )r   ÚinputÚpaddingÚfillÚmoder   )r5   r:   r   r'   r   r   r   Ústr)r   s   "r    r!   r!   @   sU   € ÷ dñ dÜ�<‰<ðdÜ"&¤s¥)ðdÜ38¼ÄÌÅÐ9OÕ3PðdÜX[ðdä
‡\�\ñdr"   c           
     ó„  € \        V\        \        34      '       d#   \        P                  ! W\        V4      VR7      # VR8w  d   \        RV R24      hV P                  ^,          p\        V\        \        34      '       d1   \        W P                  V P                  R7      P                  4       pM:\        P                  ! W P                  V P                  R7      P                  4       pVP                  4       V8w  d!   \        RVP                  4        RV R24      h\        P                  ! WR	VR7      p\        P                  ! \        P                   ! V R
,          4      VR	VR7      p\        P"                  ! VP%                  4       WeP&                  ! ^V.^.VP(                  ^,
          ,          O5!  4      # )a4  Pad ``input`` with a scalar or with one constant per channel.

``torch.nn.functional.pad`` only accepts a scalar ``value``, so a sequence ``fill`` is applied by padding
with zeros and writing the per-channel constants into the region the padding added. A sequence is only
meaningful for ``mode="constant"``.
)r   rO   Úconstantz8A sequence `fill` needs `padding_mode='constant'`, got 'z'.r7   z,`fill` must hold one value per channel: got z for z
 channels.r9   ):NNN:Né   N)r&   r'   r   ÚFÚpadÚ
ValueErrorrA   r.   r-   r   r4   r8   Úflattenr5   Ú	as_tensorr<   Ú	ones_likerC   r(   ÚviewÚndim)rL   rM   rN   rO   ÚchannelsÚvaluesÚpaddedÚinsides   &&&&    r    Ú_pad_with_fillr`   @   sJ  € ô �$œœe˜×%Ò%Ü�uŠu�U¬5°«;¸TÔBÐBàˆzÔÜÐSÐTXÐSYÐY[Ð\Ó]Ð]à�{‰{˜1�~€Hä�$œœu˜×&Ò&Ü! $¯|©|À5Ç;Á;ÔO×WÑWÓY‰ä—’ ¯l©lÀ%Ç+Á+ÔN×VÑVÓXˆØ‡|�|ƒ~˜Ô!ÜÐGÈÏÉËÐGWÐW\Ð]eÐ\fÐfpÐqÓrÐrä�UŠU�5¨°4Ô8€Fä�UŠU”5—?’? 5¨¥<Ó0°'ÀÈ4ÔP€FÜ�;Š;�v—{‘{“} f¯kªk¸!¸XÐ.bÈ!ÈÐPV×P[ÑP[Ð^_ÕP_ÕI`Ó.bÓcÐcr"   c                óP   € V ^8„  d   QhR\         R\        R\        P                  /# )r   ÚboxesrO   r   )r   rP   r5   r:   )r   s   "r    r!   r!   ^   s*   € ÷ Yñ Y¤5ð Y´ð Y¼¿¹ñ Yr"   c                ó¸  € V P                  VRR7      p\        V\        P                  4      '       g   \	        R\        V4       R24      hV P                  e   V P                  '       g   V# \        V P                  VP                  4      pVP                  VP                  VP                  RVP                  4       ^,
          ,          ,           4      R4      # )aÖ  Export ``boxes`` as one dense tensor whose trailing padding rows are exactly zero.

:class:`~kornia.geometry.boxes.Boxes` records which rows are list padding in ``_padding`` and its default export
returns a ragged list for such an object. The padding rows are zeroed after the export rather than stored as
zeros, because a zero stored box exports as ``[0, 0, 1, 1]`` in the exclusive ``'xyxy'``, ``'xywh'`` and
``'vertices'`` modes, which reads as a real one-pixel box.
T)Úas_padded_sequencez%Expected a padded tensor export. Got Ú.r9   )rS   )Ú	to_tensorr&   r5   r:   Ú	TypeErrorÚtypeÚ_paddingÚ_is_batchedr   r4   Úmasked_fillr@   rA   Údim)rb   rO   ÚoutrM   s   &&  r    Ú_boxes_to_padded_tensorrn   ^   s¡   € ð �/‰/˜$°4ˆ/Ó
8€CÜ�cœ5Ÿ<™<×(Ò(ÜÐ?ÄÀSÃ	¸{È!ÐLÓMÐMØ‡~�~Ò U×%6×%6Ð%6Øˆ
Ü$ U§^¡^°S·Z±ZÓ@€GØ�?‰?˜7Ÿ?™?¨7¯=©=¸4À3Ç7Á7Ã9ÈqÅ=Õ;QÕ+QÓRÐTWÓXÐXr"   c                ó0   € V ^8„  d   QhR\         R\        /# )r   rb   r   )r   r   )r   s   "r    r!   r!   o   s   € ÷ ñ œ
ð ¤uñ r"   c                óâ   € \        V P                  RV P                  R7      pV P                  Vn        VP                  V P                  Jd   VP	                  4        V P
                  Vn        V# )a‘  View :class:`VideoBoxes` as the frame-level :class:`Boxes` of its :math:`(B \cdot T, N, 4, 2)` storage.

The children of :class:`VideoSequential` run on the flattened frames, and their parameters (a mix's
``permutation``, a gate) index frames. ``VideoBoxes`` indexes whole videos, so a child given one would select
videos with frame indices (#6173). The view shares the storage and the validity mask.
F©rO   )r   Ú_dataÚ_modeÚ_validÚ_detach_masksrj   )rb   Úframess   & r    Ú_frame_boxesrw   o   sT   € ô �5—;‘; ¨E¯K©KÔ8€FØ—L‘L€F„MØ‡|�|˜5Ÿ;™;Ó&Ø×ÑÔØ×*Ñ*€FÔØ€Mr"   c                ó<   € V ^8„  d   QhR\         R\        R\        /# ©r   rv   Útemporal_channel_sizer   )r   r'   r   )r   s   "r    r!   r!   ~   s!   € ÷ ñ œð ´sð ¼zñ r"   c                óÐ   € \        V P                  RV P                  R7      pV P                  Vn        VP	                  V P
                  4       V P                  Vn        Wn        V# )as  Wrap frame-level :class:`Boxes` back into :class:`VideoBoxes` with ``temporal_channel_size`` frames.

A ``VideoBoxes`` is a dense container and keeps no list padding. Padding a child adds, such as the rows a partial
``RandomMosaic`` gate pads a skipped frame with, is marked invalid instead; every export zeroes invalid rows and
every indexed read or write carries them.
Frq   )r   rr   rs   rt   Ú_set_paddingri   rj   rz   )rv   rz   rb   s   && r    Ú_video_boxesr}   ~   sP   € ô �v—|‘| U°·±Ô>€EØ—=‘=€E„LØ	×Ñ�v—‘Ô'Ø×*Ñ*€EÔØ"7ÔØ€Lr"   c                ó0   € V ^8„  d   QhR\         R\        /# )r   Ú	keypointsr   )r   r   )r   s   "r    r!   r!   �   s   € ÷ ñ ¤ð ´9ñ r"   c                óT   € \        V P                  R4      pV P                  Vn        V# )a  View :class:`VideoKeypoints` as the frame-level :class:`Keypoints` of its :math:`(B \cdot T, N, 2)` storage.

As :func:`_frame_boxes` does for boxes: the children of :class:`VideoSequential` index frames, and
``VideoKeypoints`` indexes whole videos. The view shares the storage.
F)r   rr   rj   )r   rv   s   & r    Ú_frame_keypointsr�   �   s'   € ô �y—‘¨Ó.€FØ"×.Ñ.€FÔØ€Mr"   c                ó<   € V ^8„  d   QhR\         R\        R\        /# ry   )r   r'   r   )r   s   "r    r!   r!   ˜   s!   € ÷ ñ œYð ¼sð Ä~ñ r"   c                ó`   € \        V P                  R4      pV P                  Vn        Wn        V# )zlWrap frame-level :class:`Keypoints` back into :class:`VideoKeypoints` with ``temporal_channel_size`` frames.F)r   rr   rj   rz   )rv   rz   r   s   && r    Ú_video_keypointsr„   ˜   s,   € ä˜vŸ|™|¨UÓ3€IØ"×.Ñ.€IÔØ&;Ô#ØÐr"   c                ód   € V ^8„  d   QhR\         R\        3,          R\         R\        3,          /# ©r   Úf.r   ©r   r   )r   s   "r    r!   r!       s,   € ÷ ñ ”x ¤S Õ)ð ¬h°s¼C°xÕ.@ñ r"   c                ó6   a € \        S 4      R V 3R ll4       pV# )zµValidate the 2D input of the wrapped function.

Args:
    f: a function that takes the first argument as torch.Tensor.

Returns:
    the wrapped function after input is validated.

c                ó\   € V ^8„  d   QhR\         P                  R\        R\        R\        /# ©r   rL   ÚargsÚkwargsr   ©r5   r:   r   )r   s   "r    r!   Ú%_validate_input.<locals>.__annotate__¬   s,   € ÷ )ñ )”u—|‘|ð )¬Cð )¼3ð )Ä3ñ )r"   c                 óB  <€ \         P                  ! V 4      '       g   \        R \        V 4       24      h\	        V P
                  RR7       \        V \         P                  \         P                  \         P                  \         P                  .R7       S! V .VO5/ VB # )ú&Input type is not a torch.Tensor. Got )Úrequired_shapes©Úaccepted_dtypes©ÚBCHW)r5   Ú	is_tensorrg   rh   Ú_validate_shaperA   Ú_validate_input_dtypeÚbfloat16Úfloat16Úfloat32rB   )rL   rŒ   r�   r‡   s   &*,€r    ÚwrapperÚ _validate_input.<locals>.wrapper«   su   ø€ ä�Š˜u×%Ò%ÜÐDÄTÈ%Ã[ÀMÐRÓSÐSä˜Ÿ™°YÕ?Ü˜e´e·n±nÄeÇmÁmÔUZ×UbÑUbÔdi×dqÑdqÐ5rÕsá�Ð(˜Ò( Ñ(Ð(r"   r   ©r‡   r�   s   f r    Ú_validate_inputr        s"   ø€ ô ˆ1ƒX÷)ó ð)ð €Nr"   c                ód   € V ^8„  d   QhR\         R\        3,          R\         R\        3,          /# r†   rˆ   )r   s   "r    r!   r!   ¸   s,   € ÷ ñ œ #¤s (Õ+ð ´¸¼c¸Õ0Bñ r"   c                ó6   a € \        S 4      R V 3R ll4       pV# )zµValidate the 3D input of the wrapped function.

Args:
    f: a function that takes the first argument as torch.Tensor.

Returns:
    the wrapped function after input is validated.

c                ó\   € V ^8„  d   QhR\         P                  R\        R\        R\        /# r‹   rŽ   )r   s   "r    r!   Ú'_validate_input3d.<locals>.__annotate__Ä   s,   € ÷ 	)ñ 	)”u—|‘|ð 	)¬Cð 	)¼3ð 	)Ä3ñ 	)r"   c                 ój  <€ \         P                  ! V 4      '       g   \        R \        V 4       24      h\	        V P
                  4      pV^8w  d   \        RV R24      h\        V \         P                  \         P                  \         P                  \         P                  .R7       S! V .VO5/ VB # )r‘   z"Expect input of 5 dimensions, got z insteadr“   )r5   r—   rg   rh   r=   rA   ÚAssertionErrorr™   rš   r›   rœ   rB   )rL   rŒ   r�   Úinput_shaper‡   s   &*, €r    r�   Ú"_validate_input3d.<locals>.wrapperÃ   s“   ø€ ä�Š˜u×%Ò%ÜÐDÄTÈ%Ã[ÀMÐRÓSÐSä˜%Ÿ+™+Ó&ˆØ˜!ÔÜ Ð#EÀkÀ]ÐRZÐ![Ó\Ð\Ü˜e´e·n±nÄeÇmÁmÔUZ×UbÑUbÔdi×dqÑdqÐ5rÕsá�Ð(˜Ò( Ñ(Ð(r"   r   rŸ   s   f r    Ú_validate_input3dr©   ¸   s"   ø€ ô ˆ1ƒX÷	)ó ð	)ð €Nr"   c                óÄ   € V ^8„  d   QhR\         \        P                  \        \        P                  \        P                  3,          3,          R\        P                  /# ©r   rL   r   ©r   r5   r:   r   ÚSize)r   s   "r    r!   r!   Ò   sA   € ÷ ñ œe¤E§L¡L´%¼¿¹ÄeÇlÁlÐ8RÕ2SÐ$SÕTð ÔY^×YcÑYcñ r"   c                ó˜   € \        V \        4      '       d   \        V ^ ,          4      pVP                  # \        V 4      pVP                  # )z³Return the (B, C, H, W) shape of a 2D augmentation input, or of the image of an (input, transform) tuple.

Input may be either (torch.Tensor,) or (torch.Tensor, transform_matrix)
)r&   r-   Ú_transform_inputrA   ©rL   Ú
tensor_vars   & r    Ú_infer_batch_shaper²   Ò   sF   € ô
 0:¸%Ä×/GÒ/GÔ! %¨¥(Ó+€JØ×ÑÐô N^Ð^cÓMd€JØ×ÑÐr"   c                óÄ   € V ^8„  d   QhR\         \        P                  \        \        P                  \        P                  3,          3,          R\        P                  /# r«   r¬   )r   s   "r    r!   r!   Û   sA   € ÷ ñ ¤¤e§l¡l´E¼%¿,¹,ÌÏÉÐ:TÕ4UÐ&UÕ Vð Ô[`×[eÑ[eñ r"   c                ó˜   € \        V \        4      '       d   \        V ^ ,          4      pVP                  # \        V 4      pVP                  # )z·Return the (B, C, D, H, W) shape of a 3D augmentation input, or of the volume of an (input, transform) tuple.

Input may be either (torch.Tensor,) or (torch.Tensor, transform_matrix)
)r&   r-   Ú_transform_input3drA   r°   s   & r    Ú_infer_batch_shape3dr¶   Û   sF   € ô
 2<¸EÄ5×1IÒ1IÔ# E¨!¥HÓ-€JØ×ÑÐô PbÐbgÓOh€JØ×ÑÐr"   c                ó„   € V ^8„  d   QhR\         P                  R\         P                  R\        R\         P                  /# ©r   rL   Úreference_shapeÚmatch_channelr   ©r5   r:   r(   )r   s   "r    r!   r!   ä   s8   € ÷ ñ Ü�<‰<ðÜ*/¯,©,ðÜGKðä
‡\�\ñr"   c                ó  € \        V4      ^8¼  d
   VR,          MRp\        V4      ^8¼  d
   VR,          MRp\        V P                  4      ^8X  d   V P                  ^ 4      p \        V P                  4      ^8X  d:   W0P                  R,          8X  d   V P                  ^4      MV P                  ^ 4      p V'       d/   V'       d'   V P                  R,          V8X  g   \        R4      h V # V'       d   Vf   \        R4      hV # )a,  Add the missing batch or channel dimension of an image tensor, e.g. a mask, to match a (B, C, H, W) reference.

Arguments:
    input: torch.Tensor to be transformed
    reference_shape: shape used as reference
    match_channel: if True, C_{src} == C_{ref}. otherwise, no constrain. C =1 by default

NúNThe C dimension of torch.Tensor did not match with the reference torch.Tensor.ú5The reference torch.Tensor do not have a C dimension!éüÿÿÿéýÿÿÿ©r=   rA   Ú	unsqueezerV   ©rL   r¹   rº   ÚBÚCs   &&&  r    Ú_transform_input_by_shaperÆ   ä   sÔ   € ô  # ?Ó3°qÔ8ˆ˜Ö¸d€AÜ" ?Ó3°qÔ8ˆ˜Ö¸d€Aä
ˆ5�;‰;Ó˜1ÔØ—‘ Ó"ˆä
ˆ5�;‰;Ó˜1Ôð '(¯;©;°r­?Ô&:�—‘ Ô"ÀÇÁÐPQÓ@RˆçŸØ�{‰{˜2� !Ô#ÜÐmÓnÐnð $ð
 €L÷ 
˜1š9ÜÐPÓQÐQà€Lr"   c                ó„   € V ^8„  d   QhR\         P                  R\         P                  R\        R\         P                  /# r¸   r»   )r   s   "r    r!   r!     s8   € ÷  ñ  Ü�<‰<ð Ü*/¯,©,ð ÜGKð ä
‡\�\ñ r"   c                ó  € \        V4      ^8¼  d
   VR,          MRp\        V4      ^8¼  d
   VR,          MRp\        V P                  4      ^8X  d   V P                  ^ 4      p \        V P                  4      ^8X  d:   W0P                  R,          8X  d   V P                  ^4      MV P                  ^ 4      p V'       d/   V'       d'   V P                  R,          V8X  g   \        R4      h V # V'       d   Vf   \        R4      hV # )a2  Add the missing batch or channel dimension of a volume tensor, e.g. a mask, to match a (B, C, D, H, W) reference.

A ``(D, H, W)`` input becomes ``(1, 1, D, H, W)``. A 4-dim input whose first size equals the reference batch size
is read as ``(B, D, H, W)`` and becomes ``(B, 1, D, H, W)``; any other 4-dim input is read as ``(C, D, H, W)`` and
becomes ``(1, C, D, H, W)``.

Arguments:
    input: torch.Tensor to be transformed
    reference_shape: shape used as reference
    match_channel: if True, C_{src} == C_{ref}. otherwise, no constrain. C =1 by default

Nr½   r¾   éûÿÿÿr¿   rÁ   rÃ   s   &&&  r    Ú_transform_input3d_by_shaperÊ     sÔ   € ô  # ?Ó3°qÔ8ˆ˜Ö¸d€AÜ" ?Ó3°qÔ8ˆ˜Ö¸d€Aä
ˆ5�;‰;Ó˜1ÔØ—‘ Ó"ˆä
ˆ5�;‰;Ó˜1Ôð '(¯;©;°r­?Ô&:�—‘ Ô"ÀÇÁÐPQÓ@RˆçŸØ�{‰{˜2� !Ô#ÜÐmÓnÐnð $ð
 €L÷ 
˜1š9ÜÐPÓQÐQà€Lr"   z(either (H, W), (C, H, W) or (*, C, H, W)z1either (D, H, W), (C, D, H, W) or (*, C, D, H, W)c                óP   € V ^8„  d   QhR\         P                  R\        R\        /# )r   rA   Úacceptedr   )r5   r­   rP   r	   )r   s   "r    r!   r!   +  s*   € ÷ pñ p¤5§:¡:ð p¼ð pÄñ pr"   c                ó:   € \        RV RV  2\        V 4      R7      h)a  Raise the :class:`~kornia.core.exceptions.InputRankError` every augmentation entry point uses for a bad rank.

Args:
    shape: the shape of the rejected input.
    accepted: the accepted shapes, such as ``_IMAGE_SHAPES``, completing "must have a shape of ...".

z Input size must have a shape of ú. Got )Úactual_shape)r   r-   )rA   rÌ   s   &&r    Ú_raise_input_rank_errorrÐ   +  s&   € ô Ð;¸H¸:ÀVÈEÈ7ÐSÔbgÐhmÓbnÔ
oÐor"   c                óX   € V ^8„  d   QhR\         P                  R\         P                  /# r«   ©r5   r:   )r   s   "r    r!   r!   6  s"   € ÷ ñ œEŸL™Lð ¬U¯\©\ñ r"   c                ó€  € \         P                  ! V 4      '       g   \        R\        V 4       24      h\	        V P
                  4      R9  d   \        V P
                  \        4       \	        V P
                  4      ^8X  d   V P                  ^ 4      p \	        V P
                  4      ^8X  d   V P                  ^ 4      p V # )z¥Unsqueeze an ``(H, W)`` or ``(C, H, W)`` image tensor to 4 dims, ``(B, C, H, W)``; a 4-dim input is kept.

Args:
    input: torch.Tensor

Returns:
    torch.Tensor

r‘   )r   é   é   )	r5   r—   rg   rh   r=   rA   rÐ   Ú_IMAGE_SHAPESrÂ   ©rL   s   &r    r¯   r¯   6  sŒ   € ô �?Š?˜5×!Ò!ÜÐ@ÄÀeÃÀÐNÓOÐOä
ˆ5�;‰;Ó˜yÔ(Ü §¡¬]Ô;ä
ˆ5�;‰;Ó˜1ÔØ—‘ Ó"ˆä
ˆ5�;‰;Ó˜1ÔØ—‘ Ó"ˆà€Lr"   c                óX   € V ^8„  d   QhR\         P                  R\         P                  /# r«   rÒ   )r   s   "r    r!   r!   O  s"   € ÷ ñ œeŸl™lð ¬u¯|©|ñ r"   c                ó€  € \         P                  ! V 4      '       g   \        R\        V 4       24      h\	        V P
                  4      R9  d   \        V P
                  \        4       \	        V P
                  4      ^8X  d   V P                  ^ 4      p \	        V P
                  4      ^8X  d   V P                  ^ 4      p V # )z§Unsqueeze a ``(D, H, W)`` or ``(C, D, H, W)`` volume to 5 dims, ``(B, C, D, H, W)``; a 5-dim input is kept.

Args:
    input: torch.Tensor

Returns:
    torch.Tensor

r‘   )rÔ   rÕ   é   )	r5   r—   rg   rh   r=   rA   rÐ   Ú_VOLUME_SHAPESrÂ   r×   s   &r    rµ   rµ   O  sŒ   € ô �?Š?˜5×!Ò!ÜÐ@ÄÀeÃÀÐNÓOÐOä
ˆ5�;‰;Ó˜yÔ(Ü §¡¬^Ô<ä
ˆ5�;‰;Ó˜1ÔØ—‘ Ó"ˆä
ˆ5�;‰;Ó˜1ÔØ—‘ Ó"ˆà€Lr"   c                ór   € V ^8„  d   QhR\         P                  R\        \         P                  ,          RR/# )r   rL   r”   r   N)r5   r:   r   r8   )r   s   "r    r!   r!   h  s4   € ÷ Sñ S¤§¡ð SÄÄUÇ[Á[Õ@Qð SÐVZñ Sr"   c                ó^   € V P                   V9  d   \        RV RV P                    24      hR# )z«Raise TypeError unless the dtype of ``input`` is one of ``accepted_dtypes``.

Args:
    input: torch.Tensor
    accepted_dtypes: List. e.g. [torch.float32, torch.float64]
zExpected input of rÎ   N)r8   rg   )rL   r”   s   &&r    r™   r™   h  s3   € ð ‡{�{˜/Ô)ÜÐ,¨_Ð,=¸VÀEÇKÁKÀ=ÐQÓRÐRñ *r"   r¹   c                ó´   € V ^8„  d   QhR\         P                  R\        \        R3,          R\        \         P                  ,          R\         P                  /# )r   ÚoutputrA   .r¹   r   )r5   r:   r   r'   r
   )r   s   "r    r!   r!   s  sE   € ÷ ñ Ü�L‰LðÜ!&¤s¨C x¥ðÜFNÌuÏ|É|ÕF\ðä
‡\�\ñr"   c               óŽ  € T p\        \        VP                  4      \        V4      ,
          4       F�  p^ pVe=   VP                  ^ ,          V^ ,          u;8X  d   ^8w  d   M M\        V4      ^8”  d   ^pVP                  V,          ^8w  d#   \        RV RVP                  V,           24      hVP	                  V4      pK’  	  V# )a  Collapse the broadcasted batch dimensions an input torch.Tensor to be the specified shape.

Args:
    output: torch.Tensor
    shape: List/tuple of int
    reference_shape: torch.Tensor representation of shape to control which dimensions are collapsed.

Returns:
    torch.Tensor

z
Dimension z# of input is expected to be 1, got )Úranger=   rA   r¦   Úsqueeze)rß   rA   r¹   Ú
out_tensorrl   Úidxs   &&$   r    Ú_transform_output_shaperå   s  s»   € ð €Jä”S˜×)Ñ)Ó*¬S°«ZÕ7Ö8ˆØˆØÒ&¨:×+;Ñ+;¸AÕ+>À/ÐRSÕBTÖ+YÐXY×+YÔ^aÐbgÓ^hÐklÔ^lØˆCØ×Ñ˜CÕ  AÔ%Ü  :¨c¨UÐ2UÐV`×VfÑVfÐgjÕVkÐUlÐ!mÓnÐnØ×'Ñ'¨Ó,Š
ñ 9ð Ðr"   c                óž   € V ^8„  d   QhR\         \        \        R3,          \        P                  3,          R\        \
        R3,          RR/# )r   rA   .r’   r   N)r   r   r'   r5   r­   rP   )r   s   "r    r!   r!   Ž  sJ   € ÷ Tñ Tœ5¤¤s¨C x¥´%·*±*Ð!<Õ=ð TÔPUÔVYÐ[^ÐV^ÕP_ð TÐptñ Tr"   c                óŠ   € RpV F   p\        V 4      \        V4      8X  g   K  Rp M	  V'       g   \        RV RV  R24      hR# )z¿Raise TypeError unless ``shape`` has as many dimensions as one of ``required_shapes``, e.g. ``"BCHW"``.

Args:
    shape: torch.Tensor shape
    required_shapes: List. e.g. ["BCHW", "BCDHW"]
FTzExpected input shape in rÎ   re   N)r=   rg   )rA   r’   ÚpassedÚrequired_shapes   &&  r    r˜   r˜   Ž  sS   € ð €FÛ)ˆÜˆu‹:œ˜^Ó,Ö,ØˆFÙñ *÷ ÜÐ2°?Ð2CÀ6È%ÈÐPQÐRÓSÐSñ r"   c                ó\   € V ^8„  d   QhR\         P                  R\        R\        R\        /# )r   rL   Úchannel_indexÚnumberr   )r5   r:   r'   r(   )r   s   "r    r!   r!   ž  s-   € ÷ 0ñ 0¤§¡ð 0¼cð 0Ì3ð 0ÔSWñ 0r"   c                ó.   € V P                   V,          V8H  # )a2  Validate if an input has the right shape.

e.g. to check if an input is channel first.
If channel first, the second channel of an RGB input shall be fixed to 3. To verify using:
    _validate_input_shape(input, 1, 3)

Args:
    input: torch.Tensor
    channel_index: int
    number: int
Returns:
    bool

)rA   )rL   rë   rì   s   &&&r    Ú_validate_input_shaperî   ž  s   € ð �;‰;�}Õ%¨Ñ/Ð/r"   c                óê   € V ^8„  d   QhR\         \        \        R3,          \        P                  3,          R\        P
                  P                  R\        \        ,          R\        P                  /# ©r   rA   .ÚdistÚsame_on_batchr   ©
r   r   r'   r5   r­   ÚdistributionsÚDistributionr
   r(   r:   )r   s   "r    r!   r!   °  sZ   € ÷ ñ Ü””s˜C�x•¤%§*¡*Ð,Õ-ðä
×
Ñ
×
*Ñ
*ðô œD•>ðô ‡\�\ñ	r"   c                ój  € \        V \        4      '       d   \        P                  ! V 4      p V'       dp   \        P                  ! ^.V R,          O54      pVP	                  V4      pVP
                  ! V ^ ,          .^.\        VP                  4      ^,
          ,          O5!  # VP	                  V 4      # )züDraw a reparameterized sample of ``shape`` from ``dist``, one draw repeated over the batch if same_on_batch.

If same_on_batch is True, all values generated will be exactly same given a batch_size (shape[0]). By default,
same_on_batch is set to False.
ºrS   NN)r&   r-   r5   r­   ÚrsampleÚrepeatr=   rA   )rA   rñ   rò   Úrsample_sizerø   s   &&&  r    Ú_adapted_rsamplingrû   °  s„   € ô �%œ×ÒÜ—
’
˜5Ó!ˆçÜ—z’z 1 / u¨R¥y¡/Ó2ˆØ—,‘,˜|Ó,ˆØ�~Š~˜e A�hÐH¨!¨´°G·M±MÓ0BÀQÕ0FÕ)GÓHÐHØ�<‰<˜ÓÐr"   c                óx   € V ^8„  d   QhR\         P                  R\         P                  R\         P                  /# )r   ÚdrawÚextentr   rÒ   )r   s   "r    r!   r!   Ä  s2   € ÷ lñ lœUŸ\™\ð l´5·<±<ð lÄEÇLÁLñ lr"   c                óþ   € \         P                  ! V P                  VP                  4      p\        WP                  V4      VP                  V4      ,          P                  4       P                  VP                  4      # )ae  Turn a ``[0, 1)`` draw into an integer start in ``[0, extent)`` for a crop or patch.

The product and the floor are taken in the wider of the two dtypes and the result is cast to the dtype of
``extent``. Casting the draw to a narrower ``extent`` dtype first rounds a draw close to 1 up to 1.0, which
puts the start one past the last valid position (#5052).
)r5   Úpromote_typesr8   r   r4   r>   Úfloor)rý   rþ   r8   s   && r    Ú_truncate_to_startr  Ä  sX   € ô ×Ò §
¡
¨F¯L©LÓ9€EÜ" 4¯©¸Ó>ÀÇÁÈ5ÓAQÕQ×XÑXÓZ×]Ñ]Ð^d×^jÑ^jÓkÐkr"   c                óê   € V ^8„  d   QhR\         \        \        R3,          \        P                  3,          R\        P
                  P                  R\        \        ,          R\        P                  /# rð   ró   )r   s   "r    r!   r!   Ï  sZ   € ÷ ñ Ü””s˜C�x•¤%§*¡*Ð,Õ-ðä
×
Ñ
×
*Ñ
*ðô œD•>ðô ‡\�\ñ	r"   c                óN  € \        V \        4      '       d   \        P                  ! V 4      p V'       db   VP	                  \        P                  ! ^.V R,          O54      4      P
                  ! V ^ ,          .^.\        V 4      ^,
          ,          O5!  # VP	                  V 4      # )zýDraw a sample of ``shape`` from ``dist`` without reparameterization, one draw for the batch if same_on_batch.

If same_on_batch is True, all values generated will be exactly same given a batch_size (shape[0]). By default,
same_on_batch is set to False.
r÷   )r&   r-   r5   r­   Úsamplerù   r=   )rA   rñ   rò   s   &&&r    Ú_adapted_samplingr  Ï  s{   € ô �%œ×ÒÜ—
’
˜5Ó!ˆçØ�{‰{œ5Ÿ:š: q o¨5°­9¡oÓ6Ó7×>Ò>¸uÀQ½xÐaÈ1È#ÔQTÐUZÓQ[Ð^_ÕQ_ÕJ`ÓaÐaØ�;‰;�uÓÐr"   c          
      ó$  € V ^8„  d   QhR\         \        \        R3,          \        P                  3,          R\         \
        \        P                  3,          R\         \
        \        P                  3,          R\        R\        P                  /# )r   rA   .ÚlowÚhighrò   r   ©r   r   r'   r5   r­   r   r:   r(   )r   s   "r    r!   r!   á  sp   € ÷ :ñ :Ü””s˜C�x•¤%§*¡*Ð,Õ-ð:ä	Œu”e—l‘lÐ"Õ	#ð:ô ””u—|‘|Ð#Õ
$ð:ô ð	:ô
 ‡\�\ñ:r"   c                ó:  € \        \        V\        P                  4      '       d   TMR\        V\        P                  4      '       d   TMR.4      w  rE\        P                  ! WVR7      p\        P                  ! W$VR7      p\        WRR7      p\        WV4      # )a¢  Draw a reparameterized sample of ``shape`` from Uniform(low, high), one draw for the batch if same_on_batch.

If same_on_batch is True, all values generated will be exactly same given a batch_size (shape[0]). By default,
same_on_batch is set to False.

By default, sampling happens on the default device and dtype. If low/high is a torch.Tensor,
sampling will happen in the same device/dtype as low/high torch.Tensor.
Nr7   F©Úvalidate_args)r   r&   r5   r:   rX   r   rû   )rA   r  r	  rò   r4   r8   rñ   s   &&&&   r    Ú_adapted_uniformr  á  s}   € ô *Ü˜3¤§¡×-Ò-‰°4ÄÈDÔRW×R^ÑR^×A_ÒA_¹ÐeiÐjó�M€Fô �/Š/˜#°EÔ
:€CÜ�?Š?˜4°eÔ<€Dô �3¨EÔ2€DÜ˜e¨=Ó9Ð9r"   c          
      ó$  € V ^8„  d   QhR\         \        \        R3,          \        P                  3,          R\         \
        \        P                  3,          R\         \
        \        P                  3,          R\        R\        P                  /# )r   rA   .ÚaÚbrò   r   r
  )r   s   "r    r!   r!   ú  sp   € ÷ :ñ :Ü””s˜C�x•¤%§*¡*Ð,Õ-ð:äŒU”E—L‘LÐ Õ!ð:ô ŒU”E—L‘LÐ Õ!ð:ô ð	:ô
 ‡\�\ñ:r"   c                ó:  € \        \        V\        P                  4      '       d   TMR\        V\        P                  4      '       d   TMR.4      w  rE\        P                  ! WVR7      p\        P                  ! W$VR7      p\        WRR7      p\        WV4      # )an  Sample from a beta sampling function that accepts 'same_on_batch'.

If same_on_batch is True, all values generated will be exactly same given a batch_size (shape[0]). By default,
same_on_batch is set to False.

By default, sampling happens on the default device and dtype. If a/b is a torch.Tensor,
sampling will happen in the same device/dtype as a/b torch.Tensor.
Nr7   Fr  )r   r&   r5   r:   rX   r   rû   )rA   r  r  rò   r4   r8   rñ   s   &&&&   r    Ú_adapted_betar  ú  sx   € ô *Ü˜œEŸL™L×)Ò)‰¨t¼*ÀQÌÏÉ×:UÒ:U±QÐ[_Ð`ó�M€Fô 	�Š˜°Ô6€AÜ�Š˜°Ô6€AÜ� EÔ*€DÜ˜e¨=Ó9Ð9r"   c                ó¦   € V ^8„  d   QhR\         P                  R\        \        \        R3,          \
        \        ,          3,          R\        RR/# )r   ÚparamrA   .Únamer   N)r5   r:   r   r   r'   r   rP   )r   s   "r    r!   r!     sJ   € ÷ _ñ _œUŸ\™\ð _´%¼¼cÀ3¸h½ÌÌcÍÐ8RÕ2Sð _Ô[^ð _Ðcgñ _r"   c                 óŒ   € V P                   \        P                  ! V4      8w  d   \        R V RV RV P                    24      hR# )zInvalid shape for z. Expected rÎ   N)rA   r5   r­   r¦   )r  rA   r  s   &&&r    Ú_shape_validationr    sB   € Ø‡{�{”e—j’j Ó'Ô'ÜÐ1°$°°{À5À'ÈÐPU×P[ÑP[È}Ð]Ó^Ð^ñ (r"   c                ót   € V ^8„  d   QhR\         \        \        3,          R\         \        \        3,          /# )r   Úparamsr   ©r   rP   r   )r   s   "r    r!   r!     s*   € ÷ ñ œ$œs¤C˜x�.ð ¬T´#´s°(­^ñ r"   c                óä   € / pV P                  4        FY  w  r#\        V\        P                  4      '       d#   VP	                  W#P                  4       /4       KG  VP	                  W#/4       K[  	  V# )a�  Copy an augmentation parameter dictionary while cloning tensor values.

``copied = deepcopy_dict(params)`` returns a new dictionary whose tensor values are ``clone()`` copies; non-tensor
values are kept by reference. Use ``override_parameters`` to copy and replace selected entries.

See Also:
    - :class:`~kornia.augmentation.container.ImageSequential`: stores parameter dictionaries for replay.

)Úitemsr&   r5   r:   ÚupdateÚclone)r  rm   Úkr*   s   &   r    Údeepcopy_dictr!    sU   € ð €CØ—‘–‰ˆä�aœŸ™×&Ò&Ø�J‰J˜Ÿ7™7›9�~Ö&à�J‰J˜�vÖñ ð €Jr"   c                óÐ   € V ^8„  d   QhR\         \        \        3,          R\        \         \        \        3,          ,          R\        R\        R\         \        \        3,          /# )r   r  Úparams_overrideÚif_none_existÚin_placer   )r   rP   r   r
   r(   )r   s   "r    r!   r!   *  sW   € ÷ 'ñ 'Ü””c��Nð'äœd¤3¬ 8�nÕ-ð'ô ð'ô ð	'ô
 
Œ#Œsˆ(…^ñ'r"   c                óæ   € V'       g   V # V'       d   T M
\        V 4      pVP                  4        F=  w  rVWP9   d   WdV&   K  VR8X  d   K  VR8X  d   \        RV R24      h\        RV R24      h	  V# )a!  Replace selected entries of an augmentation parameter dictionary.

``updated = override_parameters(params, params_override)`` returns a copied dictionary with existing keys
replaced, unless ``in_place=True``. With no override it returns ``params`` itself; use ``deepcopy_dict`` when a
new dictionary with cloned tensor values is needed without replacement. Cloning preserves autograd history;
non-tensor values remain shared.

Args:
    params: source parameters.
    params_override: key-values to override the source parameters.
    if_none_exist: ``"ignore"`` skips keys absent from ``params``; ``"raise"`` raises ``RuntimeError``.
    in_place: if to override in-place or not.

See Also:
    - :class:`~kornia.augmentation.container.ImageSequential`: accepts recorded parameter lists for replay.

ÚignoreÚraisezParam `z*` does not exist in the source parameters.Ú`z` is not a valid option.)r!  r  ÚRuntimeErrorrV   )r  r#  r$  r%  rm   r   r*   s   &&&&   r    Úoverride_parametersr+  *  s   € ÷6 Øˆß‰&¤-°Ó"7€CØ×%Ñ%Ö'‰ˆØŒ;Ø�‹FØ˜hÔ&ÙØ˜gÔ%Ü ¨¨Ð+UÐVÓWÐWä˜q  Ð/GÐHÓIÐIñ (ð €Jr"   c                óf   € V ^8„  d   QhR\         \        P                  \        3,          R\        /# r«   )r   r5   r:   r   )r   s   "r    r!   r!   T  s(   € ÷ 	ñ 	¤¤e§l¡l´IÐ&=Õ >ð 	Ä9ñ 	r"   c                óz  € \        V \        P                  4      '       dm   \        V P                  4      ^8X  d.   V P                  R,          \        P
                  ! ^.4      8X  g   \        RV P                   R24      h\        V R4      p \        V \        4      '       d   \        R\        V 4       R24      hV # )zPreprocess input keypoints.r÷   z*Only BxNx2 torch.Tensor is supported. Got re   FzExpect `Keypoints` type. Got )	r&   r5   r:   r=   rA   r­   r*  r   rh   r×   s   &r    Úpreprocess_keypointsr.  T  s�   € ô �%œŸ™×&Ò&Ü�E—K‘KÓ  AÔ%¨%¯+©+°b­/¼U¿ZºZÈÈ»_Ô*LÜÐ!KÈEÏKÉKÈ=ÐXYÐZÓ[Ð[Ü˜% Ó'ˆÜ�%œ×#Ò#ÜÐ:¼4À»;¸-ÀqÐIÓJÐJØ€Lr"   c                óX   € V ^8„  d   QhR\         P                  R\         P                  /# r«   rÒ   )r   s   "r    r!   r!   `  s"   € ÷ ñ œeŸl™lð ¬u¯|©|ñ r"   c                ó   € V # )zPreprocess input class tags.© r×   s   &r    Úpreprocess_classesr2  `  s	   € ð €Lr"   c                   óB   a a€ ] tR tRt oRtV3R lV 3R lltRtVtV ;t# )ÚMultiprocessWrapperif  zYWhen used as a base class, makes the class work with the 'spawn' multiprocessing context.c                ó*   <€ V ^8„  d   QhRS[ RS[ RR/# )r   rŒ   r�   r   N)r   )r   Ú__classdict__s   "€r    r!   Ú MultiprocessWrapper.__annotate__i  s"   ø€ ÷ *ñ *™cð *©Sð *°Tñ *r"   c           	     ó4  <€ \         ;QJ d    . R  V 4       F  NK  	  5M! R  V 4       4      pVP                  4        UUu/ uF8  w  r4T\        V\        P                  4      '       d   VP                  4       MTbK:  	  ppp\        SV `  ! V/ VB  R# u uppi )c              3   ó†   "  € T F7  p\        V\        P                  4      '       d   VP                  4       MTx € K9  	  R # 5ir%   )r&   r5   r:   r  )r)   Úargs   & r    r+   Ú/MultiprocessWrapper.__init__.<locals>.<genexpr>j  s-   é € Ð[ÑVZÈs¤J¨s´E·L±L×$AÒ$A�S—Y‘Y”[ÀsÔJÓVZùs   ‚?AN)r-   r  r&   r5   r:   r  ÚsuperÚ__init__)ÚselfrŒ   r�   ÚkeyÚvalÚ	__class__s   &*,  €r    r=  ÚMultiprocessWrapper.__init__i  s{   ø€ ßŒuÑ[ÑVZÓ[�u‰uÑ[ÑVZÓ[Ó[ˆØ]c×]iÑ]iÔ]kÔlÑ]kÑQYÐQT�#¤j°´e·l±l×&CÒ&C�s—y‘y”{ÈÒLÑ]kˆÑlä‰Ò˜$Ð) &Ô)ùó ms   Á>Br1  )	Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r=  Ú__static_attributes__Ú__classdictcell__Ú__classcell__)rA  r6  s   @@r    r4  r4  f  s   ù‡ € Ùc÷*÷ *ó *r"   r4  c                ó0   € V ^8„  d   QhR\         R\        /# r   )r   r(   )r   s   "r    r!   r!   p  s   € ÷ ñ œsð ¤tñ r"   c                óì  € \        V \        P                  4      '       d   V P                  '       * # \        V \        4      '       dQ   \
        ;QJ d*    R V P                  4        4       F  '       g   K   R# 	  R# ! R V P                  4        4       4      # \        V \        \        34      '       d5   \
        ;QJ d    R V  4       F  '       g   K   R# 	  R# ! R V  4       4      # \        V \        P                  P                  4      '       dc   \
        ;QJ d3    R \        V 4      P                  4        4       F  '       g   K   R# 	  R# ! R \        V 4      P                  4        4       4      # R# )zÉWhether ``value`` holds a tensor with autograd history, directly, in a container or in a distribution.

``copy.deepcopy`` refuses such a tensor, and pickle turns it into a leaf cut off from the graph.
c              3   ó8   "  € T F  p\        V4      x € K  	  R # 5ir%   ©Ú_holds_graph_tensor©r)   Úitems   & r    r+   Ú&_holds_graph_tensor.<locals>.<genexpr>x  s   é € ÐH¹°Ô& t×,Ð,»ùó   ‚TFc              3   ó8   "  € T F  p\        V4      x € K  	  R # 5ir%   rN  rP  s   & r    r+   rR  z  s   é € Ð?¹°Ô& t×,Ð,»ùrS  c              3   ó8   "  € T F  p\        V4      x € K  	  R # 5ir%   rN  rP  s   & r    r+   rR  |  s   é € ÐNÑ9M°Ô& t×,Ð,Ó9MùrS  )r&   r5   r:   Úis_leafÚdictÚanyr]   r.   r-   rô   rõ   Úvars)r   s   &r    rO  rO  p  sý   € ô
 �%œŸ™×&Ò&Ø—=‘=Ô Ð Ü�%œ×Òß‹sÑH¸¿¹¼ÓH�sŒsÐHŠsÐHˆsÑH¸¿¹¼ÓHÓHÐHÜ�%œ$¤˜×'Ò'ß‹sÑ?¹Ó?�sŒsÐ?ŠsÐ?ˆsÑ?¹Ó?Ó?Ð?Ü�%œ×,Ñ,×9Ñ9×:Ò:ß‹sÑN¼¸e»×9KÑ9KÔ9MÓN�sŒsÐNŠsÐNˆsÑN¼¸e»×9KÑ9KÔ9MÓNÓNÐNÙr"   c                ó^   € V ^8„  d   QhR\         R\        \        \         3,          R\         /# )r   r   Úmemor   )r   r   r'   )r   s   "r    r!   r!   €  s)   € ÷ ñ ¤ð ¬D´´c°­Nð ¼sñ r"   c                ó¨  a€ \        V 4      '       g   V # \        V 4      S9   d   S\        V 4      ,          # \        V \        P                  4      '       d   V P                  4       pMÒ\        V \        4      '       d+   \        V 4      ! V3R lV P                  4        4       4      pM’\        V \        4      '       d   V  Uu. uF  p\        VS4      NK  	  ppM`\        V \        4      '       dI   V  Uu. uF  p\        VS4      NK  	  pp\        V R4      '       d   \        V 4      ! V!  M
\        V4      pMT pVS\        V 4      &   V# u upi u upi )zéReturn ``value`` with each tensor that has autograd history detached; ``memo`` keeps shared values shared.

Dicts, lists and tuples (named tuples included) on the way to such a tensor are rebuilt; anything else is
returned as it is.
c              3   óD   <"  € T F  w  rV\        VS4      3x € K  	  R # 5ir%   ©Ú_detach_graph_tensors)r)   r?  rQ  r[  s   &  €r    r+   Ú(_detach_graph_tensors.<locals>.<genexpr>Ž  s"   øé € ÐbÑTaÁyÀs˜3Ô 5°d¸DÓ AÕBÓTaùs   ƒ Ú_fields)rO  Úidr&   r5   r:   rE   rW  rh   r  r.   r_  r-   Úhasattr)r   r[  rm   rQ  r  s   &f   r    r_  r_  €  s
  ø€ ô ˜u×%Ò%ØˆÜ	ˆ%ƒy�DÔØ”B�u“I�Ðä�%œŸ™×&Ò&Ø�l‰l‹n‰Ü	�Eœ4×	 Ò	 Ü�5ŒkÔbÐTY×T_ÑT_ÔTaÓbÓb‰Ü	�Eœ4×	 Ò	 Ù=BÓC¹U°TÔ$ T¨4Ö0¹UˆÐCˆÜ	�Eœ5×	!Ò	!Ù?DÓE¹u°tÔ& t¨TÖ2¹uˆÐEÜ%,¨U°I×%>Ò%>Œd�5Œk˜5Ò!ÄEÈ%ÃL‰àˆØ€DŒˆE‹�OØ€Jùò DùâEs   ÃE
Ã4Ec                ót   € V ^8„  d   QhR\         \        \        3,          R\         \        \        3,          /# )r   Ústater   r  )r   s   "r    r!   r!   š  s*   € ÷ ñ ¬$¬s´C¨x­.ð ¼TÄ#ÄsÀ(½^ñ r"   c                ó~   € / pV  Uu. uF  q"R9  g   K  VNK  	  up F  p\        W,          V4      W&   K  	  V # u upi )aË  Detach the autograd history in a module state's plain attributes, for ``__getstate__``.

With a learnable range, what a forward records on the module (the drawn parameters, the transformation matrix)
is part of the autograd graph of that call. A copy cannot extend the original's graph, and ``copy.deepcopy``
refuses such tensors, so the copy keeps their values, detached. Parameters, buffers and submodules follow their
own copy protocol and are left alone.
)Ú_parametersÚ_buffersÚ_modulesr^  )re  r[  r  s   &  r    Ú_detach_recorded_graph_tensorsrj  š  sF   € ð €DÙ"'Ó_¡%˜$Ð7^Ñ+^—�¡%Ô_ˆÜ+¨E­K¸Ó>ˆ‹ñ `à€Lùò `s   ‡:”:Úreflectc                 ó"   € V ^,          ^,           # ©r   r1  ©rþ   s   &r    Ú<lambda>ro  ¯  s   € ˜f¨�k¨Ažor"   Úcircularc                 ó   € V ^,          # rm  r1  rn  s   &r    ro  ro  °  s   € ˜v¨ž{r"   Úvalidc                 ó   € V # r%   r1  rn  s   &r    ro  ro  ±  s   € ™Fr"   c                óÈ   € V ^8„  d   QhR\         R\        P                  R\        \        \
        \        R3,          \        \        ,          3,          R\         R\        RR/# )	r   r  rL   Úkernel_size.Úborder_typeÚspatial_dimsr   N)rP   r5   r:   r   r'   r   r   )r   s   "r    r!   r!   ¸  s`   € ÷ ñ Ü
ðä�<‰<ðô ”sœE¤# s (�O¬T´#­YÐ6Õ7ðô ð	ô
 ðð 
ñr"   c                ó|  € \        V\        4      '       d   V3V,          M
\        V4      p\        P	                  \        V4      P                  4       4      pVf   R# V^8X  d   RMRw  rx\        V) R p	\        W•VP                  V) R 4       F©  w  r«pV! \        V4      4      pWÍ8  g   K  \        T  RT R\        ;QJ d    . R V 4       F  NK  	  5M! R V 4       4       RV: RT RT RT
 R	\        ;QJ d    . R
 VP                   4       F  NK  	  5M! R
 VP                   4       4       R24      h	  R# )aX  Refuse an image the filter's padding cannot handle, naming the class and the shape.

torch raises about "padding size" or "calculated padded input size" from two layers below,
which names neither the augmentation nor the image the caller passed. ``spatial_dims`` is the
number of trailing axes the kernel spans: 2 for an image, 3 for a volume.
Nz cannot filter z this small: kernel_size=c              3   ó8   "  € T F  p\        V4      x € K  	  R # 5ir%   ©r'   ©r)   Úss   & r    r+   Ú)_check_filter_min_size.<locals>.<genexpr>Ð  s   é € Ð.© Aœ˜QŸ˜«ùrS  z with border_type=z needs at least Ú z
(s) along z, but the input is c              3   ó8   "  € T F  p\        V4      x € K  	  R # 5ir%   rz  r{  s   & r    r+   r}  Ò  s   é € Ð5© Aœ˜QŸ˜«ùrS  re   )zan imageÚpixel)za volumeÚvoxel)r&   r'   r-   Ú_MIN_FILTERED_SIZEÚgetrP   ÚlowerÚ_SPATIAL_AXIS_NAMESÚziprA   rV   )r  rL   ru  rv  rw  ÚsizeÚsmallestÚsubjectÚunitÚaxesÚaxisrþ   ÚsideÚminimums   &&&&&         r    Ú_check_filter_min_sizer�  ¸  s(  € ô -7°{ÄC×,HÒ,HˆKˆ>˜LÖ(ÌeÐT_ÓN`€DÜ!×%Ñ%¤c¨+Ó&6×&<Ñ&<Ó&>Ó?€HØÒÙØ-9¸QÔ->Ñ)ÐDY�M€GÜ ˜}˜~Ð.€DÜ! $¨e¯k©k¸<¸-¸.Ð.IÖJÑˆ�dÙœ3˜v›;Ó'ˆØŽ>ÜØ�&˜¨ yÐ0Iß”5Ñ.©Ó.—5‘5Ñ.©Ó.Ó.Ð/Ð/AÀ+ÁÐP`Ø�)˜1˜T˜F *¨T¨FÐ2Eß”5Ñ5¨¯ªÓ5—5‘5Ñ5¨¯ªÓ5Ó5Ð6°að9óð ó Kr"   c                ó†   € V ^8„  d   Qh/ ^ \         9   d-   \        \        \        \        .\        3,          3,          ;R&   # )r   r‚  )Ú__conditional_annotations__r   rP   r   r'   )r   s   "r    r!   r!      s5   € × Ñ ÷xò ”Dœœh¬ u¬c zÕ2Ð2Õ3ñ òy r"   )T)r•   )F)Nr'  F)ÚdepthÚheightÚwidth)rk  r   )Lr‘  Ú	functoolsr   Útypingr   r   r   r   r	   r
   r   r   r   r5   Útorch.nn.functionalÚnnÚ
functionalrT   Útorch.distributionsr   r   Úkornia.core.exceptionsr   Úkornia.core.opsr   r   Úkornia.core.utilsr   r   Úkornia.geometry.boxesr   r   Úkornia.geometry.keypointsr   r   r0   rJ   r`   rn   rw   r}   r�   r„   r    r©   r²   r¶   rÆ   rÊ   rÖ   rÛ   rÐ   r¯   rµ   r™   rå   r˜   rî   rû   r  r  r  r  r  r!  r+  r.  r2  r4  rO  r_  rj  r‚  r…  r�  r!   )r‘  s   @r    Ú<module>r      s9  øð÷$ Ò ß X× XÕ Xã ß Ð ß -õ 2ß ?ß Kß 3ß ?õõDõ,dõ<Yõ"õõõõõ0õ4õ÷÷> ðH ;€ØD€õpõõ2õ2SðØ_c÷÷6Tõ 0÷$õ(l÷÷$:÷2:õ._õ
÷('õT	õ÷*ñ *õõ õ4ð* Ñ-ØÑ*ØÑ"ð7Ð ó ð 3Ð ÷ñ r"   