+
    ˜°³já  ã                   ó¢   € R t ^ RIHtHt ^ RIHt ^ RIHtHt ^ RI	H
t
 ^ RIHtHt . ROt ! R R4      t]! R]
R	7      tRR
 R lltRR R lltR# )z;Weight Normalization from https://arxiv.org/abs/1602.07868.)ÚAnyÚTypeVar)Ú
deprecated)Ú_weight_normÚnorm_except_dim©ÚModule)Ú	ParameterÚUninitializedParameterÚ
WeightNormc                   óª   a € ] tR t^t o V 3R lR ltV 3R lR lt]]! R]R7      V 3R lR l4       4       t	V 3R	 lR
 lt
V 3R lR ltV 3R ltRtV tR# )r   c                ó*   <€ V ^8„  d   QhRS[ RS[RR/# )é   ÚnameÚdimÚreturnN©ÚstrÚint)ÚformatÚ__classdict__s   "€Ú[/home/luca/screen-checking/.venv/lib/python3.14/site-packages/torch/nn/utils/weight_norm.pyÚ__annotate__ÚWeightNorm.__annotate__   s"   ø€ ÷ ñ ™Sð ¡sð ¨tñ ó    c                ó*   € Vf   RpWn         W n        R # )Néÿÿÿÿ)r   r   )Úselfr   r   s   &&&r   Ú__init__ÚWeightNorm.__init__   s   € ØŠ;ØˆCØŒ	ØŽr   c                ó&   <€ V ^8„  d   QhRS[ RS[/# )r   Úmoduler   ©r   r   )r   r   s   "€r   r   r      s   ø€ ÷ ,ñ ,¡Vð ,±ñ ,r   c                óž   € \        WP                  R ,           4      p\        WP                  R,           4      p\        W2V P                  4      # )Ú_gÚ_v)Úgetattrr   r   r   )r   r!   ÚgÚvs   &&  r   Úcompute_weightÚWeightNorm.compute_weight   s9   € Ü�FŸI™I¨Õ,Ó-ˆÜ�FŸI™I¨Õ,Ó-ˆÜ˜A $§(¡(Ó+Ð+r   ze`torch.nn.utils.weight_norm` is deprecated in favor of `torch.nn.utils.parametrizations.weight_norm`.)Úcategoryc                ó*   <€ V ^8„  d   QhRS[ RS[RR/# )r   r   r   r   r   r   )r   r   s   "€r   r   r   %   s"   ø€ ÷ ñ ™Cð ¡cð ¨lñ r   c           
     óh  € V P                   P                  4        F:  p\        V\        4      '       g   K  VP                  V8X  g   K.  \        R V 24      h	  Vf   Rp\        W4      p\        W4      p\        V\        4      '       d   \        R4      hV P                  V V P                  VR,           \        \        V^V4      P                  4      4       V P                  VR,           \        VP                  4      4       \        WVP                  V 4      4       V P!                  V4       V# )z<Cannot register two weight_norm hooks on the same parameter zŽThe module passed to `WeightNorm` can't have uninitialized parameters. Make sure to run the dummy forward before applying weight normalizationr$   r%   r   )Ú_forward_pre_hooksÚvaluesÚ
isinstancer   r   ÚRuntimeErrorr&   r
   Ú
ValueErrorÚ_parametersÚregister_parameterr	   r   ÚdataÚsetattrr)   Úregister_forward_pre_hook)r!   r   r   ÚhookÚfnÚweights   &&&   r   ÚapplyÚWeightNorm.apply   s  € ð ×-Ñ-×4Ñ4Ö6ˆDÜ˜$¤
×+Ô+°·	±	¸TÖ0AÜ"ØRÐSWÐRXÐYóð ñ 7ð Š;ØˆCä˜Ó"ˆä˜Ó&ˆÜ�fÔ4×5Ò5ÜðZóð ð
 ×Ñ˜tÐ$ð 	×!Ñ!Ø�4�Kœ¤?°6¸1¸cÓ#B×#GÑ#GÓHô	
ð 	×!Ñ! $¨¥+¬y¸¿¹Ó/EÔFÜ�˜b×/Ñ/°Ó7Ô8ð 	×(Ñ(¨Ô,àˆ	r   c                ó$   <€ V ^8„  d   QhRS[ RR/# )r   r!   r   Nr   )r   r   s   "€r   r   r   F   s   ø€ ÷ ;ñ ;™Vð ;¨ñ ;r   c                ó  € V P                  V4      p\        WP                  4       VP                  V P                  R ,            VP                  V P                  R,            \	        WP                  \        VP                  4      4       R# )r$   r%   N)r)   Údelattrr   r3   r6   r	   r5   )r   r!   r:   s   && r   ÚremoveÚWeightNorm.removeF   sc   € Ø×$Ñ$ VÓ,ˆÜ�Ÿ	™	Ô"Ø×Ñ˜tŸy™y¨4Õ/Ð0Ø×Ñ˜tŸy™y¨4Õ/Ð0Ü�Ÿ	™	¤9¨V¯[©[Ó#9Ö:r   c                ó*   <€ V ^8„  d   QhRS[ RS[RR/# )r   r!   Úinputsr   Nr"   )r   r   s   "€r   r   r   M   s'   ø€ ÷ @ñ @™vð @©sð @°tñ @r   c                óP   € \        WP                  V P                  V4      4       R # )N)r6   r   r)   )r   r!   rC   s   &&&r   Ú__call__ÚWeightNorm.__call__M   s   € Ü�Ÿ	™	 4×#6Ñ#6°vÓ#>Ö?r   c                ó2   <€ V ^8„  d   Qh/ S[ ;R&   S[;R&   # )r   r   r   r   )r   r   s   "€r   r   r      s   ø‡ ‚ Ù
�Iñ á	�Hò r   )r   r   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__r   r)   Ústaticmethodr   ÚFutureWarningr;   r@   rE   Ú__annotate_func__Ú__static_attributes__Ú__classdictcell__)r   s   @r   r   r      sb   ø‡ € ÷ð ÷,ð ,ð
 Ùð	Eàô÷
óó ð÷B;ð ;÷@ð @÷} ƒ r   ÚT_module)Úboundc                óH   € V ^8„  d   QhR\         R\        R\        R\         /# )r   r!   r   r   r   )rQ   r   r   )r   s   "r   r   r   T   s(   € ÷ >ñ >œð >¬ð >¼Sð >Ìñ >r   c                ó2   € \         P                  WV4       V # )aú  Apply weight normalization to a parameter in the given module.

.. math::
     \mathbf{w} = g \dfrac{\mathbf{v}}{\|\mathbf{v}\|}

Weight normalization is a reparameterization that decouples the magnitude
of a weight tensor from its direction. This replaces the parameter specified
by :attr:`name` (e.g. ``'weight'``) with two parameters: one specifying the magnitude
(e.g. ``'weight_g'``) and one specifying the direction (e.g. ``'weight_v'``).
Weight normalization is implemented via a hook that recomputes the weight
tensor from the magnitude and direction before every :meth:`~Module.forward`
call.

By default, with ``dim=0``, the norm is computed independently per output
channel/plane. To compute a norm over the entire weight tensor, use
``dim=None``.

See https://arxiv.org/abs/1602.07868

.. warning::

    This function is deprecated.  Use :func:`torch.nn.utils.parametrizations.weight_norm`
    which uses the modern parametrization API.  The new ``weight_norm`` is compatible
    with ``state_dict`` generated from old ``weight_norm``.

    Migration guide:

    * The magnitude (``weight_g``) and direction (``weight_v``) are now expressed
      as ``parametrizations.weight.original0`` and ``parametrizations.weight.original1``
      respectively.  If this is bothering you, please comment on
      https://github.com/pytorch/pytorch/issues/102999

    * To remove the weight normalization reparameterization, use
      :func:`torch.nn.utils.parametrize.remove_parametrizations`.

    * The weight is no longer recomputed once at module forward; instead, it will
      be recomputed on every access.  To restore the old behavior, use
      :func:`torch.nn.utils.parametrize.cached` before invoking the module
      in question.

Args:
    module (Module): containing module
    name (str, optional): name of weight parameter
    dim (int, optional): dimension over which to compute the norm

Returns:
    The original module with the weight norm hook

Example::

    >>> warnings.filterwarnings("ignore", message=".*torch.nn.utils.weight_norm")  # docs: hide
    >>> m = weight_norm(nn.Linear(20, 40), name='weight')
    >>> m
    Linear(in_features=20, out_features=40, bias=True)
    >>> m.weight_g.size()
    torch.Size([40, 1])
    >>> m.weight_v.size()
    torch.Size([40, 20])

)r   r;   )r!   r   r   s   &&&r   Úweight_normrU   T   s   € ôz ×Ñ�V 3Ô'Ø€Mr   c                ó<   € V ^8„  d   QhR\         R\        R\         /# )r   r!   r   r   )rQ   r   )r   s   "r   r   r   •   s&   € ÷ Gñ Gœxð G¬sð GÄ(ñ Gr   c                ó   € V P                   P                  4        FP  w  r#\        V\        4      '       g   K  VP                  V8X  g   K0  VP                  V 4       V P                   V V u # 	  \        RV RV  24      h)al  Remove the weight normalization reparameterization from a module.

Args:
    module (Module): containing module
    name (str, optional): name of weight parameter

Example:
    >>> warnings.filterwarnings(
    ...     "ignore", message=".*torch.nn.utils.weight_norm"
    ... )  # docs: hide
    >>> m = weight_norm(nn.Linear(20, 40))
    >>> remove_weight_norm(m)
zweight_norm of 'z' not found in )r.   Úitemsr0   r   r   r@   r2   )r!   r   Úkr8   s   &&  r   Úremove_weight_normrZ   •   sq   € ð ×,Ñ,×2Ñ2Ö4‰ˆÜ�dœJ×'Ô'¨D¯I©I¸Ö,=Ø�K‰K˜ÔØ×)Ñ)¨!Ð,ØŠMñ	 5ô Ð'¨ v¨_¸V¸HÐEÓ
FÐFr   N)r   rU   rZ   )r:   é    )r:   )Ú__doc__Útypingr   r   Útyping_extensionsr   Útorchr   r   Útorch.nn.modulesr   Útorch.nn.parameterr	   r
   Ú__all__r   rQ   rU   rZ   © r   r   Ú<module>rd      sK   ðá Bç Ý (ç /Ý #ß @ò >€÷?@ñ ?@ñD �: VÔ,€÷>÷BGñ Gr   