+
    üäûj*%  ã                   óÎ   € ^ RI HtHtHtHtHtHtHtHt ^ RI	t	^ RI	H
t
Ht ^ RIHt ^ RIHt ^ RIHtHt ^ RIHtHtHt ^ RIHt ^ RIHtHt ^ R	IHt ^ R
IH t   ! R R]]4      t!R# )é    )ÚAnyÚDictÚIteratorÚListÚOptionalÚTupleÚUnionÚcastN)ÚSizeÚnn©ÚOperationBase)ÚImageSequentialBaseÚTransformMatrixMinIn)ÚInputSequentialOpsÚ_filter_child_optionsÚ_validate_extra_args)Ú	ParamItem)Ú_transform_inputÚoverride_parameters©Úeye_like)Úis_exportingc                   óü   a a€ ] tR t^!t oRtV3R lV 3R lltV3R lR ltV3R lV 3R lltV3R lR	 ltV3R
 lR lt	RV3R lR llt
V3R lR ltRV3R lV 3R llltV3R lR ltRV3R lR lltRtVtV ;t# )ÚPolicySequentiala)  Apply one ordered sub-policy of automatic augmentation operations.

``output = PolicySequential(*operations)(input)`` applies the wrapped operations in order and records their
parameters for replay. Use :class:`~kornia.augmentation.auto.AutoAugment` to sample one of a searched policy's
sub-policies.

Convention:
    - accepts only :class:`~kornia.augmentation.auto.operations.OperationBase` children. Generated parameters
      apply every child in construction order. Supplied ``params`` define the execution path instead: their
      order and membership select the referenced children, so they may replay a reordered or partial path.
      ``forward`` stores the ``ParamItem`` objects for the path it executed in ``_params``; those parameters can
      replay the same operations through ``forward(input, params=...)``.
    - its transformation matrix is the ordered product of its geometric wrapped operations. Intensity
      operations do not contribute to that matrix.
    - ``forward_parameters`` uses :meth:`~kornia.augmentation.auto.operations.OperationBase.forward_parameters`
      for each child, so the operation's magnitude, magnitude mapping and symmetric sign apply; the gate comes
      from the wrapped augmentation's ``p`` and ``p_batch``.

Args:
    operations: the operations to perform, passed as positional arguments rather than as one list.

See Also:
    - :class:`~kornia.augmentation.auto.operations.OperationBase`: wraps an individual policy operation.
    - :class:`~kornia.augmentation.auto.AutoAugment`: selects from a fixed searched policy.

c                ó$   <€ V ^8„  d   QhRS[ RR/# ©é   Ú
operationsÚreturnNr   )ÚformatÚ__classdict__s   "€ÚfC:\Ai_Coding\apps\studio\ComfyUI\.venv\Lib\site-packages\kornia\augmentation\auto\operations\policy.pyÚ__annotate__ÚPolicySequential.__annotate__=   s   ø€ ÷ Vñ V¡Mð V°dñ Vó    c                ó\   <€ V P                   ! V!   \        SV `  ! V!   \        3V n        R # ©N)Úvalidate_operationsÚsuperÚ__init__r   Ú$_valid_ops_for_transform_computation)Úselfr   Ú	__class__s   &*€r#   r+   ÚPolicySequential.__init__=   s)   ø€ Ø× Ò  *Ò-Ü‰Ò˜*Ò%ÜFSÐEUˆÖ1r&   c                ó8   <€ V ^8„  d   QhRS[ P                  RR/# )r   Úmoduler    N)r   ÚModule)r!   r"   s   "€r#   r$   r%   B   s#   ø€ ÷ Añ A¹B¿I¹Ið AÈ$ñ Ar&   c                óP   € V P                   P                  VP                  4       R # r(   )Ú_transform_matricesÚappendÚtransform_matrix©r-   r1   s   &&r#   Ú%_update_transform_matrix_for_valid_opÚ6PolicySequential._update_transform_matrix_for_valid_opB   s   € Ø× Ñ ×'Ñ'¨×(?Ñ(?Ö@r&   c                ó   <€ V ^8„  d   QhRR/# )r   r    N© )r!   r"   s   "€r#   r$   r%   E   s   ø€ ÷ %ñ %˜Tñ %r&   c                ó@   <€ V P                  4        \        SV `	  4       # )z4Reset cached params and transformation-matrix state.)Ú_reset_transform_matrix_stater*   Úclear_state)r-   r.   s   &€r#   r>   ÚPolicySequential.clear_stateE   s   ø€ à×*Ñ*Ô,Ü‰wÑ"Ó$Ð$r&   c                ó$   <€ V ^8„  d   QhRS[ RR/# r   r   )r!   r"   s   "€r#   r$   r%   J   s   ø€ ÷ ^ñ ^©}ð ^Àñ ^r&   c                ó¬   € . pV F,  p\        V\        4      '       d   K  VP                  V4       K.  	  \        V4      ^ 8w  d   \	        RV R24      hR# )zÚEnsure all provided modules are :class:`OperationBase` instances.

Args:
    *operations: Operations passed to :class:`PolicySequential`.

Raises:
    ValueError: Any provided operation is not a Kornia auto operation.
z.All operations must be Kornia Operations. Got Ú.N)Ú
isinstancer   r5   ÚlenÚ
ValueError)r-   r   Úinvalid_opsÚops   &*  r#   r)   Ú$PolicySequential.validate_operationsJ   sX   € ð ,.ˆÛˆBÜ˜b¤-×0Ô0Ø×"Ñ" 2Ö&ñ ô ˆ{Ó˜qÔ ÜÐMÈkÈ]ÐZ[Ð\Ó]Ð]ñ !r&   c                óN   <€ V ^8„  d   QhRS[ P                  RS[ P                  /# )r   Úinputr    )ÚtorchÚTensor)r!   r"   s   "€r#   r$   r%   Z   s#   ø€ ÷ "ñ "¡U§\¡\ð "±e·l±lñ "r&   c                ó   € \        ^V4      # )zReturn identity matrix.r   )r-   rJ   s   &&r#   Úidentity_matrixÚ PolicySequential.identity_matrixZ   s   € ä˜˜5Ó!Ð!r&   c                ó¦   <€ V ^8„  d   QhRS[ P                  RS[S[S[,          ,          RS[RS[S[S[S[3,          ,          RS[ P                  /# )r   rJ   ÚparamsÚ	recomputeÚ
extra_argsr    )	rK   rL   r   r   r   Úboolr   Ústrr   )r!   r"   s   "€r#   r$   r%   ^   s[   ø€ ÷ *ñ *á�|‰|ð*ñ ™™i�Õ)ð*ñ ð	*ñ
 ™T¡#¡s (�^Õ,ð*ñ 
�‰ñ*r&   c                ó  € Vf   \        R4      h\        WV4      pV P                  V4      pV P                  \	        V4      4      p\        YRe   TM. 4       EF¯  w  w  rxp	\        \        V4      p\        W„V	4      p
\        VP                  \        P                  34      '       g   KR  \        V	P                  \        4      '       g   Kt  VP                  pVP                  P!                  V4      pV'       dJ   \#        VP                  P$                  V
RR7      pVP                  P'                  WP                  V4      pM^VP                  P(                  e9   \*        P,                  ! VP(                  VP.                  VP0                  R7      pM\3        V R24      hWÖ,          pVP                  P5                  W4      pVP                  P6                  '       g   EKŒ  W±P                  8w  g   EKŸ  VP9                  4       pEK²  	  V# )aj  Compute the transformation matrix according to the provided parameters.

Args:
    input: the input torch.Tensor.
    params: params for the sequence.
    recompute: if to recompute the transformation matrix according to the params.
        default: False.
    extra_args: Optional dictionary of extra arguments with specific options for different input types.

zrequires params to be provided.F)Úin_place)ÚdeviceÚdtypez2.transform_matrix is None while `recompute=False`.)ÚNotImplementedErrorr   Úget_forward_sequencerN   r   Úzipr
   r   r   rC   rG   ÚKÚGeometricAugmentationBase2DÚdataÚdictÚshapeÚtransform_tensorr   ÚflagsÚgenerate_transformation_matrixr6   rK   Ú	as_tensorrX   rY   ÚRuntimeErrorÚtransform_output_tensorÚkeepdimÚsqueeze)r-   rJ   rQ   rR   rS   Únamed_modulesÚres_matÚ_r1   ÚparamÚ
child_argsÚ	ori_shaperc   Úmats   &&&&&         r#   Úget_transformation_matrixÚ*PolicySequential.get_transformation_matrix^   sŽ  € ð" Š>Ü%Ð&GÓHÐHÜ)¨$¸FÓCˆ
Ø9=×9RÑ9RÐSYÓ9Zˆð !%× 4Ñ 4Ô5EÀeÓ5LÓ MˆÜ"% mÒ?Q±VÐWY×"ZÑ‰KˆQ˜Üœ-¨Ó0ˆFÜ.¨vÀ5ÓIˆJÜ˜&Ÿ)™)¤a×&CÑ&CÐ%E×FÔFÌ:ÐV[×V`ÑV`Ôbf×KgÔKgØ!ŸK™K�	ØŸ	™	×2Ñ2°5Ó9�çÜ/°·	±	·±ÀÐV[Ô\�EØ Ÿ)™)×BÑBÀ5Ï*É*ÐV[Ó\‘CØ—Y‘Y×/Ñ/Ò;ÜŸ/š/¨&×*AÑ*AÈ%Ï,É,Ð^c×^iÑ^iÔj‘Cä&¨&¨Ð1cÐ'dÓeÐeØ�-�ØŸ	™	×9Ñ9¸%ÓK�Ø—9‘9×$×$Ó$¨·k±k×)AØ%Ÿo™oÓ/“Gñ# #[ð$ ˆr&   c                ó    <€ V ^8„  d   QhRS[ /# )r   r    )rT   )r!   r"   s   "€r#   r$   r%   Š   s   ø€ ÷ 
ñ 
¡4ñ 
r&   c                ó°   € V P                  4        FA  p\        \        V4      p\        VP                  \
        P                  34      '       g   K@   R# 	  R# )z|Check whether the policy contains only intensity transforms.

Returns:
    ``True`` when no geometric operation is present.
FT)Úchildrenr
   r   rC   rG   r]   r^   r7   s   & r#   Úis_intensity_onlyÚ"PolicySequential.is_intensity_onlyŠ   sB   € ð —m‘m–oˆFÜœ-¨Ó0ˆFÜ˜&Ÿ)™)¤a×&CÑ&CÐ%E×FÔFÚñ &ñ r&   c                ó€   <€ V ^8„  d   QhRS[ S[S[,          ,          RS[S[S[S[P                  3,          ,          /# )r   rQ   r    )r   r   r   r   r   rU   r   r2   )r!   r"   s   "€r#   r$   r%   –   s=   ø€ ÷ %ñ %©8±D¹µOÕ+Dð %ÑPXÑY^Ñ_bÑdf×dmÑdmÐ_mÕYnÕPoñ %r&   c                óJ   <€ Ve   \         SV `  V4      # V P                  4       # )zäReturn the operation sequence used for execution.

Args:
    params: Optional recorded parameters. When provided, only modules
        referenced by those params are returned.

Returns:
    Iterator of ``(name, module)`` pairs.
)r*   Úget_children_by_paramsÚnamed_children)r-   rQ   r.   s   &&€r#   r[   Ú%PolicySequential.get_forward_sequence–   s*   ø€ ð ÒÜ‘7Ñ1°&Ó9Ð9Ø×"Ñ"Ó$Ð$r&   c                ó6   <€ V ^8„  d   QhRS[ RS[S[,          /# )r   Úbatch_shaper    )r   r   r   )r!   r"   s   "€r#   r$   r%   ¤   s   ø€ ÷ ñ ©dð ±t¹Iµñ r&   c                óº   € V P                  4       p. pV FB  w  rE\        \        V4      pVP                  V4      p\	        WF4      pVP                  V4       KD  	  V# )zÐGenerate parameter dictionaries for each operation in the policy.

Args:
    batch_shape: Input shape used to sample operation parameters.

Returns:
    List of :class:`ParamItem` objects in execution order.
)r[   r
   r   Úforward_parametersr   r5   )r-   r~   rj   rQ   Únamer1   Ú	mod_paramrm   s   &&      r#   r€   Ú#PolicySequential.forward_parameters¤   s\   € ð :>×9RÑ9RÓ9Tˆà"$ˆã)‰LˆDÜœ-¨Ó0ˆFØ×1Ñ1°+Ó>ˆIÜ˜dÓ.ˆEØ�M‰M˜%Ö ñ	 *ð
 ˆr&   c          	      ó�   <€ V ^8„  d   QhRS[ P                  RS[S[,          RS[S[S[S[3,          ,          RS[ P                  /# )r   rJ   rQ   rS   r    )rK   rL   r   r   r   r   rU   r   )r!   r"   s   "€r#   r$   r%   ¸   sK   ø€ ÷ ñ Ù—\‘\ðÙ+/±	­?ðÙHPÑQUÑVYÑ[^ÐV^ÕQ_ÕH`ðá	�‰ñr&   c                ó  € \        WV4      pV P                  4        V FG  pV P                  VP                  4      p\        P
                  ! WWCR7      pV P                  V4       KI  	  \        4       '       g   W n        V# )að  Apply all operations using a prepared parameter list.

Leaves the policy in the same state as :meth:`forward` with these ``params``: the cached
transformation matrix is rebuilt from this call and ``_params`` records ``params``. This is the
entry point used when the policy is nested inside another container.

Args:
    input: Input tensor.
    params: Parameters for each operation in this policy.
    extra_args: Optional overrides forwarded to child modules.

Returns:
    Transformed tensor.
)r1   rm   rS   )	r   r=   Úget_submoduler�   r   Ú	transformÚ"_update_transform_matrix_by_moduler   Ú_params)r-   rJ   rQ   rS   rm   r1   s   &&&&  r#   Útransform_inputsÚ!PolicySequential.transform_inputs¸   sm   € ô" *¨$¸FÓCˆ
Ø×*Ñ*Ô,ÛˆEØ×'Ñ'¨¯
©
Ó3ˆFÜ&×0Ò0°ÈUÔjˆEØ×3Ñ3°FÖ;ñ ô �~Š~Ø!ŒLØˆr&   )r‰   r,   )NFNr(   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r+   r8   r>   r)   rN   rq   rv   r[   r€   rŠ   Ú__static_attributes__Ú__classdictcell__Ú__classcell__)r.   r"   s   @@r#   r   r   !   sz   ù‡ € ñ÷6Vó V÷
Að A÷%ó %÷
^ð ^÷ "ð "÷*ò *÷X
ð 
÷%õ %÷ð ÷(÷ ò r&   r   )"Útypingr   r   r   r   r   r   r	   r
   rK   r   r   Úkornia.augmentationÚaugmentationr]   Ú#kornia.augmentation.auto.operationsr   Ú"kornia.augmentation.container.baser   r   Ú!kornia.augmentation.container.opsr   r   r   Ú$kornia.augmentation.container.paramsr   Úkornia.augmentation.utilsr   r   Úkornia.core.opsr   Úkornia.core.utilsr   r   r;   r&   r#   Ú<module>rž      sD   ð÷$ K× JÓ Jã ß å Ý =ß Xß mÑ mÝ :ß KÝ $Ý *ôpÐ+Ð-@ö pr&   