+
    –°³jB(  ã                   óŠ  € R t ^ RIHtHt ^ RIHt . ROt ! R R4      t]! 4       t]! 4       t	]P                  ]P                  4      ]	P                  ]P                  4      R 4       4       t]P                  ]P                  4      R 4       t]	P                  ]P                  4      R 4       t]P                  ]P                   4      ]P                  ]P"                  4      ]	P                  ]P                   4      ]	P                  ]P"                  4      R 4       4       4       4       t]P                  ]P&                  4      ]P                  ]P(                  4      ]	P                  ]P&                  4      ]	P                  ]P(                  4      R	 4       4       4       4       t]P                  ]P,                  4      ]	P                  ]P,                  4      R
 4       4       t]P                  ]P0                  4      ]P                  ]P2                  4      ]	P                  ]P0                  4      ]	P                  ]P2                  4      R 4       4       4       4       t]P                  ]P6                  4      R 4       t]	P                  ]P6                  4      R 4       t]	P                  ]P<                  4      R 4       t]	P                  ]P@                  4      ]	P                  ]PB                  4      R 4       4       t"]P                  ]PF                  4      ]	P                  ]PF                  4      R 4       4       t$]P                  ]PJ                  4      R 4       t&]	P                  ]PJ                  4      R 4       t']P                  ]PP                  4      R 4       t)]	P                  ]PP                  4      R 4       t*R# )aF  
PyTorch provides two global :class:`ConstraintRegistry` objects that link
:class:`~torch.distributions.constraints.Constraint` objects to
:class:`~torch.distributions.transforms.Transform` objects. These objects both
input constraints and return transforms, but they have different guarantees on
bijectivity.

1. ``biject_to(constraint)`` looks up a bijective
   :class:`~torch.distributions.transforms.Transform` from ``constraints.real``
   to the given ``constraint``. The returned transform is guaranteed to have
   ``.bijective = True`` and should implement ``.log_abs_det_jacobian()``.
2. ``transform_to(constraint)`` looks up a not-necessarily bijective
   :class:`~torch.distributions.transforms.Transform` from ``constraints.real``
   to the given ``constraint``. The returned transform is not guaranteed to
   implement ``.log_abs_det_jacobian()``.

The ``transform_to()`` registry is useful for performing unconstrained
optimization on constrained parameters of probability distributions, which are
indicated by each distribution's ``.arg_constraints`` dict. These transforms often
overparameterize a space in order to avoid rotation; they are thus more
suitable for coordinate-wise optimization algorithms like Adam::

    loc = torch.zeros(100, requires_grad=True)
    unconstrained = torch.zeros(100, requires_grad=True)
    scale = transform_to(Normal.arg_constraints["scale"])(unconstrained)
    loss = -Normal(loc, scale).log_prob(data).sum()

The ``biject_to()`` registry is useful for Hamiltonian Monte Carlo, where
samples from a probability distribution with constrained ``.support`` are
propagated in an unconstrained space, and algorithms are typically rotation
invariant.::

    dist = Exponential(rate)
    unconstrained = torch.zeros(100, requires_grad=True)
    sample = biject_to(dist.support)(unconstrained)
    potential_energy = -dist.log_prob(sample).sum()

.. note::

    An example where ``transform_to`` and ``biject_to`` differ is
    ``constraints.simplex``: ``transform_to(constraints.simplex)`` returns a
    :class:`~torch.distributions.transforms.SoftmaxTransform` that simply
    exponentiates and normalizes its inputs; this is a cheap and mostly
    coordinate-wise operation appropriate for algorithms like SVI. In
    contrast, ``biject_to(constraints.simplex)`` returns a
    :class:`~torch.distributions.transforms.StickBreakingTransform` that
    bijects its input down to a one-fewer-dimensional space; this a more
    expensive less numerically stable transform but is needed for algorithms
    like HMC.

The ``biject_to`` and ``transform_to`` objects can be extended by user-defined
constraints and transforms using their ``.register()`` method either as a
function on singleton constraints::

    transform_to.register(my_constraint, my_transform)

or as a decorator on parameterized constraints::

    @transform_to.register(MyConstraintClass)
    def my_factory(constraint):
        assert isinstance(constraint, MyConstraintClass)
        return MyTransform(constraint.param1, constraint.param2)

You can create your own registry by creating a new :class:`ConstraintRegistry`
object.
)ÚconstraintsÚ
transforms)Ú_NumberÚConstraintRegistryc                   óF   a a€ ] tR t^Pt oRtV 3R ltRR ltR tRtVt	V ;t
# )r   z-
Registry to link constraints to transforms.
c                ó2   <€ / V n         \        SV `	  4        R # ©N)Ú	_registryÚsuperÚ__init__)ÚselfÚ	__class__s   &€Úh/home/luca/screen-checking/.venv/lib/python3.14/site-packages/torch/distributions/constraint_registry.pyr   ÚConstraintRegistry.__init__U   s   ø€ ØˆŒÜ‰ÑÖó    c                ó  a a€ Vf   VV 3R l# \        S\        P                  4      '       d   \        S4      o\        S\        4      '       d!   \	        S\        P                  4      '       g   \        RS 24      hVS P                  S&   V# )a–  
Registers a :class:`~torch.distributions.constraints.Constraint`
subclass in this registry. Usage::

    @my_registry.register(MyConstraintClass)
    def construct_transform(constraint):
        assert isinstance(constraint, MyConstraint)
        return MyTransform(constraint.arg_constraints)

Args:
    constraint (subclass of :class:`~torch.distributions.constraints.Constraint`):
        A subclass of :class:`~torch.distributions.constraints.Constraint`, or
        a singleton object of the desired class.
    factory (Callable): A callable that inputs a constraint object and returns
        a  :class:`~torch.distributions.transforms.Transform` object.
c                 ó(   <€ SP                  SV 4      # r   )Úregister)ÚfactoryÚ
constraintr   s   &€€r   Ú<lambda>Ú-ConstraintRegistry.register.<locals>.<lambda>l   s   ø€  4§=¡=°¸WÔ#Er   zLExpected constraint to be either a Constraint subclass or instance, but got )Ú
isinstancer   Ú
ConstraintÚtypeÚ
issubclassÚ	TypeErrorr	   ©r   r   r   s   ff&r   r   ÚConstraintRegistry.registerY   sƒ   ù€ ð$ Š?ÝEÐEô �j¤+×"8Ñ"8×9Ò9Ü˜jÓ)ˆJä˜*¤d×+Ò+´:Øœ×.Ñ.÷4
ò 4
ô Ø^Ð_iÐ^jÐkóð ð &-ˆ�‰�zÑ"Øˆr   c                ó°   €  V P                   \        V4      ,          pT! T4      #   \         d%    \        R\        T4      P                   R24      Rhi ; i)a   
Looks up a transform to constrained space, given a constraint object.
Usage::

    constraint = Normal.arg_constraints["scale"]
    scale = transform_to(constraint)(torch.zeros(1))  # constrained
    u = transform_to(constraint).inv(scale)  # unconstrained

Args:
    constraint (:class:`~torch.distributions.constraints.Constraint`):
        A constraint object.

Returns:
    A :class:`~torch.distributions.transforms.Transform` object.

Raises:
    `NotImplementedError` if no transform has been registered.
zCannot transform z constraintsN)r	   r   ÚKeyErrorÚNotImplementedErrorÚ__name__r   s   && r   Ú__call__ÚConstraintRegistry.__call__|   s`   € ð(	Ø—n‘n¤T¨*Ó%5Õ6ˆGñ
 �zÓ"Ð"øô	 ô 	Ü%Ø#¤D¨Ó$4×$=Ñ$=Ð#>¸lÐKóàðð	ús	   ‚& ¦/A)r	   r   )r"   Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   r#   Ú__static_attributes__Ú__classdictcell__Ú__classcell__)r   Ú__classdict__s   @@r   r   r   P   s   ù‡ € ñõô!÷F#ò #r   c                 ó"   € \         P                  # r   )r   Úidentity_transform©r   s   &r   Ú_transform_to_realr0   ¢   s   € ô ×(Ñ(Ð(r   c                 ól   € \        V P                  4      p\        P                  ! WP                  4      # r   )Ú	biject_toÚbase_constraintr   ÚIndependentTransformÚreinterpreted_batch_ndims©r   Úbase_transforms   & r   Ú_biject_to_independentr8   ¨   s.   € ä˜z×9Ñ9Ó:€NÜ×*Ò*Ø×<Ñ<óð r   c                 ól   € \        V P                  4      p\        P                  ! WP                  4      # r   )Útransform_tor3   r   r4   r5   r6   s   & r   Ú_transform_to_independentr;   °   s.   € ä! *×"<Ñ"<Ó=€NÜ×*Ò*Ø×<Ñ<óð r   c                 ó,   € \         P                  ! 4       # r   )r   ÚExpTransformr/   s   &r   Ú_transform_to_positiver>   ¸   s   € ô
 ×"Ò"Ó$Ð$r   c                 ó–   € \         P                  ! \         P                  ! 4       \         P                  ! V P                  ^4      .4      # )é   )r   ÚComposeTransformr=   ÚAffineTransformÚlower_boundr/   s   &r   Ú_transform_to_greater_thanrD   À   s>   € ô
 ×&Ò&ä×#Ò#Ó%Ü×&Ò& z×'=Ñ'=¸qÓAð	
óð r   c                 ó–   € \         P                  ! \         P                  ! 4       \         P                  ! V P                  R4      .4      # )r@   éÿÿÿÿ)r   rA   r=   rB   Úupper_boundr/   s   &r   Ú_transform_to_less_thanrH   Í   s>   € ô ×&Ò&ä×#Ò#Ó%Ü×&Ò& z×'=Ñ'=¸rÓBð	
óð r   c                 óà  € \        V P                  \        4      ;'       d    V P                  ^ 8H  p\        V P                  \        4      ;'       d    V P                  ^8H  pV'       d   V'       d   \        P
                  ! 4       # V P                  pV P                  V P                  ,
          p\        P                  ! \        P
                  ! 4       \        P                  ! W44      .4      # )é    )r   rC   r   rG   r   ÚSigmoidTransformrA   rB   )r   Ú
lower_is_0Ú
upper_is_1ÚlocÚscales   &    r   Ú_transform_to_intervalrP   Ø   s¾   € ô 	�:×)Ñ)¬7Ó3×SÐS¸
×8NÑ8NÐRSÑ8Sð ô 	�:×)Ñ)¬7Ó3×SÐS¸
×8NÑ8NÐRSÑ8Sð ÷ —jÜ×*Ò*Ó,Ð,à
×
 Ñ
 €CØ×"Ñ" Z×%;Ñ%;Õ;€EÜ×&Ò&Ü	×	$Ò	$Ó	&¬
×(BÒ(BÀ3Ó(NÐOóð r   c                 ó,   € \         P                  ! 4       # r   )r   ÚStickBreakingTransformr/   s   &r   Ú_biject_to_simplexrS   î   ó   € ä×,Ò,Ó.Ð.r   c                 ó,   € \         P                  ! 4       # r   )r   ÚSoftmaxTransformr/   s   &r   Ú_transform_to_simplexrW   ó   s   € ä×&Ò&Ó(Ð(r   c                 ó,   € \         P                  ! 4       # r   )r   ÚLowerCholeskyTransformr/   s   &r   Ú_transform_to_lower_choleskyrZ   ù   rT   r   c                 ó,   € \         P                  ! 4       # r   )r   ÚPositiveDefiniteTransformr/   s   &r   Ú_transform_to_positive_definiter]   þ   s   € ô ×/Ò/Ó1Ð1r   c                 ó,   € \         P                  ! 4       # r   )r   ÚCorrCholeskyTransformr/   s   &r   Ú_transform_to_corr_choleskyr`     s   € ô ×+Ò+Ó-Ð-r   c                 óª   € \         P                  ! V P                   Uu. uF  p\        V4      NK  	  upV P                  V P
                  4      # u upi r   )r   ÚCatTransformÚcseqr2   ÚdimÚlengths©r   Úcs   & r   Ú_biject_to_catrh   
  s@   € ä×"Ò"Ø)ŸšÓ/™˜!Œ�1Ž™Ñ/°·±À×ASÑASóð ùÚ/ó   ŸAc                 óª   € \         P                  ! V P                   Uu. uF  p\        V4      NK  	  upV P                  V P
                  4      # u upi r   )r   rb   rc   r:   rd   re   rf   s   & r   Ú_transform_to_catrk     s@   € ä×"Ò"Ø",§/¢/Ó2¡/˜QŒ�aŽ¡/Ñ2°J·N±NÀJ×DVÑDVóð ùÚ2ri   c                 ó”   € \         P                  ! V P                   Uu. uF  p\        V4      NK  	  upV P                  4      # u upi r   )r   ÚStackTransformrc   r2   rd   rf   s   & r   Ú_biject_to_stackrn     s8   € ä×$Ò$Ø)ŸšÓ/™˜!Œ�1Ž™Ñ/°·±óð ùÚ/ó   ŸAc                 ó”   € \         P                  ! V P                   Uu. uF  p\        V4      NK  	  upV P                  4      # u upi r   )r   rm   rc   r:   rd   rf   s   & r   Ú_transform_to_stackrq     s8   € ä×$Ò$Ø",§/¢/Ó2¡/˜QŒ�aŽ¡/Ñ2°J·N±Nóð ùÚ2ro   N)r   r2   r:   )+r(   Útorch.distributionsr   r   Útorch.typesr   Ú__all__r   r2   r:   r   Úrealr0   Úindependentr8   r;   ÚpositiveÚnonnegativer>   Úgreater_thanÚgreater_than_eqrD   Ú	less_thanrH   ÚintervalÚhalf_open_intervalrP   ÚsimplexrS   rW   Úlower_choleskyrZ   Úpositive_definiteÚpositive_semidefiniter]   Úcorr_choleskyr`   Úcatrh   rk   Ústackrn   rq   © r   r   Ú<module>r†      sË  ðñA÷F 8Ý ò€÷F#ñ F#ñR Ó €	Ù!Ó#€ð ×Ñ�K×$Ñ$Ó%Ø×Ñ�{×'Ñ'Ó(ñ)ó )ó &ð)ð ×Ñ�K×+Ñ+Ó,ñó -ðð ×Ñ�{×.Ñ.Ó/ñó 0ðð ×Ñ�K×(Ñ(Ó)Ø
×Ñ�K×+Ñ+Ó,Ø×Ñ�{×+Ñ+Ó,Ø×Ñ�{×.Ñ.Ó/ñ%ó 0ó -ó -ó *ð%ð ×Ñ�K×,Ñ,Ó-Ø
×Ñ�K×/Ñ/Ó0Ø×Ñ�{×/Ñ/Ó0Ø×Ñ�{×2Ñ2Ó3ñó 4ó 1ó 1ó .ðð ×Ñ�K×)Ñ)Ó*Ø×Ñ�{×,Ñ,Ó-ñó .ó +ðð ×Ñ�K×(Ñ(Ó)Ø
×Ñ�K×2Ñ2Ó3Ø×Ñ�{×+Ñ+Ó,Ø×Ñ�{×5Ñ5Ó6ñó 7ó -ó 4ó *ðð$ ×Ñ�K×'Ñ'Ó(ñ/ó )ð/ð ×Ñ�{×*Ñ*Ó+ñ)ó ,ð)ð
 ×Ñ�{×1Ñ1Ó2ñ/ó 3ð/ð ×Ñ�{×4Ñ4Ó5Ø×Ñ�{×8Ñ8Ó9ñ2ó :ó 6ð2ð ×Ñ�K×-Ñ-Ó.Ø×Ñ�{×0Ñ0Ó1ñ.ó 2ó /ð.ð ×Ñ�K—O‘OÓ$ñó %ðð ×Ñ�{—‘Ó'ñó (ðð ×Ñ�K×%Ñ%Ó&ñó 'ðð ×Ñ�{×(Ñ(Ó)ñó *òr   