+
    –°³je  ã                   ó‚   € ^ RI t ^ RI Ht ^ RIHt ^ RIHt ^ RIHtHtH	t	H
t
 ^ RIHt ^ RIHtHt R.t ! R	 R]4      tR# )
é    N©ÚTensor)Úconstraints)ÚDistribution)Úbroadcast_allÚlazy_propertyÚlogits_to_probsÚprobs_to_logits)Ú binary_cross_entropy_with_logits)Ú_NumberÚNumberÚ	Geometricc                   ód  a a€ ] tR t^t oRtR]P                  R]P                  /t]P                  t
RV3R lV 3R llltRV 3R llt]V3R lR l4       t]V3R	 lR
 l4       t]V3R lR l4       t]V3R lR l4       t]V3R lR l4       t]P*                  ! 4       3R ltR tR tRtVtV ;t# )r   a<  
Creates a Geometric distribution parameterized by :attr:`probs`,
where :attr:`probs` is the probability of success of Bernoulli trials.

.. math::

    P(X=k) = (1-p)^{k} p, k = 0, 1, ...

.. note::
    :func:`torch.distributions.geometric.Geometric` :math:`(k+1)`-th trial is the first success
    hence draws samples in :math:`\{0, 1, \ldots\}`, whereas
    :func:`torch.Tensor.geometric_` `k`-th trial is the first success hence draws samples in :math:`\{1, 2, \ldots\}`.

Example::

    >>> # xdoctest: +IGNORE_WANT("non-deterministic")
    >>> m = Geometric(torch.tensor([0.3]))
    >>> m.sample()  # underlying Bernoulli has 30% chance 1; 70% chance 0
    tensor([ 2.])

Args:
    probs (Number, Tensor): the probability of sampling `1`. Must be in range (0, 1]
    logits (Number, Tensor): the log-odds of sampling `1`.
ÚprobsÚlogitsc                óz   <€ V ^8„  d   QhRS[ S[,          R,          RS[ S[,          R,          RS[R,          RR/# )é   r   Nr   Úvalidate_argsÚreturn)r   r   Úbool)ÚformatÚ__classdict__s   "€Ú^/home/luca/screen-checking/.venv/lib/python3.14/site-packages/torch/distributions/geometric.pyÚ__annotate__ÚGeometric.__annotate__2   sI   ø€ ÷ %ñ %á™� Õ%ð%ñ ™• $Õ&ð%ñ ˜d•{ð	%ð
 
ñ%ó    c           
     ó   <€ VR J VR J 8X  d   \        R4      hVe   \        V4      w  V n        M!Vf   \        R4      h\        V4      w  V n        Ve   TMTp\        V\        4      '       d   \        P                  ! 4       pMVf   \        R4      hVP                  4       p\        S	V `-  WSR7       V P                  '       dŠ   Ve„   V P                  pV^ 8„  pVP                  4       '       g[   VP                  V( ,          p\        R\        V4      P                    R\#        VP$                  4       R\'        V 4       RV 24      hR # R # R # )	Nz;Either `probs` or `logits` must be specified, but not both.zlogits is unexpectedly Nonez$probs_or_logits is unexpectedly None©r   zExpected parameter probs (z
 of shape z) of distribution z* to be positive but found invalid values:
)Ú
ValueErrorr   r   ÚAssertionErrorr   Ú
isinstancer   ÚtorchÚSizeÚsizeÚsuperÚ__init__Ú_validate_argsÚallÚdataÚtypeÚ__name__ÚtupleÚshapeÚrepr)
Úselfr   r   r   Úprobs_or_logitsÚbatch_shapeÚvalueÚvalidÚinvalid_valueÚ	__class__s
   &&&&     €r   r&   ÚGeometric.__init__2   sK  ø€ ð �TˆM˜v¨˜~Ô.ÜØMóð ð Òä)¨%Ó0‰MˆT�ZàŠ~Ü$Ð%BÓCÐCä*¨6Ó2‰NˆTŒ[Ø#(Ò#4™%¸&ˆÜ�o¤w×/Ò/ÜŸ*š*›,‰KàÒ&Ü$Ð%KÓLÐLØ)×.Ñ.Ó0ˆKÜ‰Ñ˜ÐÔBØ××Ð 5Ò#4à—J‘JˆEØ˜A‘IˆEØ—9‘9—;’;Ø %§
¡
¨E¨6Õ 2�Ü ðÜ˜U›×,Ñ,Ð-¨Z¼¸e¿k¹kÓ8JÐ7Kð L'Ü'+¨D£z lð 3AØANÀðQóð ñ ñ	 $5Ñr   c                óp  <€ V P                  \        V4      p\        P                  ! V4      pR V P                  9   d!   V P
                  P                  V4      Vn        RV P                  9   d!   V P                  P                  V4      Vn        \        \        V`'  VRR7       V P                  Vn
        V# )r   r   Fr   )Ú_get_checked_instancer   r"   r#   Ú__dict__r   Úexpandr   r%   r&   r'   )r/   r1   Ú	_instanceÚnewr5   s   &&& €r   r:   ÚGeometric.expandY   sŽ   ø€ Ø×(Ñ(¬°IÓ>ˆÜ—j’j Ó-ˆØ�d—m‘mÔ#ØŸ
™
×)Ñ)¨+Ó6ˆCŒIØ�t—}‘}Ô$ØŸ™×+Ñ+¨KÓ8ˆCŒJÜŒi˜Ñ& {À%Ð&ÔHØ!×0Ñ0ˆÔØˆ
r   c                ó    <€ V ^8„  d   QhRS[ /# ©r   r   r   )r   r   s   "€r   r   r   e   s   ø€ ÷ &ñ &‘fñ &r   c                ó6   € R V P                   ,          R ,
          # ©g      ð?©r   ©r/   s   &r   ÚmeanÚGeometric.meand   s   € à�T—Z‘ZÕ #Õ%Ð%r   c                ó    <€ V ^8„  d   QhRS[ /# r?   r   )r   r   s   "€r   r   r   i   s   ø€ ÷ ,ñ ,‘fñ ,r   c                óB   € \         P                  ! V P                  4      # ©N)r"   Ú
zeros_liker   rC   s   &r   ÚmodeÚGeometric.modeh   s   € ä×Ò §
¡
Ó+Ð+r   c                ó    <€ V ^8„  d   QhRS[ /# r?   r   )r   r   s   "€r   r   r   m   s   ø€ ÷ 5ñ 5™&ñ 5r   c                óX   € R V P                   ,          R ,
          V P                   ,          # rA   rB   rC   s   &r   ÚvarianceÚGeometric.variancel   s   € à�d—j‘jÕ  3Õ&¨$¯*©*Õ4Ð4r   c                ó    <€ V ^8„  d   QhRS[ /# r?   r   )r   r   s   "€r   r   r   q   s   ø€ ÷ ;ñ ;™ñ ;r   c                ó0   € \        V P                  R R7      # ©T)Ú	is_binary)r
   r   rC   s   &r   r   ÚGeometric.logitsp   s   € ä˜tŸz™z°TÔ:Ð:r   c                ó    <€ V ^8„  d   QhRS[ /# r?   r   )r   r   s   "€r   r   r   u   s   ø€ ÷ <ñ <‘vñ <r   c                ó0   € \        V P                  R R7      # rR   )r	   r   rC   s   &r   r   ÚGeometric.probst   s   € ä˜tŸ{™{°dÔ;Ð;r   c                óÄ  € V P                  V4      p\        P                  ! V P                  P                  4      P
                  p\        P                  ! 4       ;_uu_ 4        \        P                  P                  4       '       dT   \        P                  ! W P                  P                  V P                  P                  R 7      pVP                  VR7      pM+V P                  P                  V4      P                  V^4      pVP                  4       V P                  ) P                  4       ,          P!                  4       uuRRR4       #   + '       g   i     R# ; i))ÚdtypeÚdevice)ÚminN)Ú_extended_shaper"   Úfinfor   rY   ÚtinyÚno_gradÚ_CÚ_get_tracing_stateÚrandrZ   Úclampr<   Úuniform_ÚlogÚlog1pÚfloor)r/   Úsample_shaper-   r^   Úus   &&   r   ÚsampleÚGeometric.samplex   sÓ   € Ø×$Ñ$ \Ó2ˆÜ�{Š{˜4Ÿ:™:×+Ñ+Ó,×1Ñ1ˆÜ�]Š]�_�_Ü�x‰x×*Ñ*×,Ò,ä—J’J˜u¯J©J×,<Ñ,<ÀTÇZÁZ×EVÑEVÔW�Ø—G‘G �GÓ%‘à—J‘J—N‘N 5Ó)×2Ñ2°4¸Ó;�Ø—E‘E“G §
¡
˜{×1Ñ1Ó3Õ3×:Ñ:Ó<÷ �_�_‹_ús   Á#C EÅE	c                óD  € V P                   '       d   V P                  V4       \        WP                  4      w  rVP	                  \
        P                  R 7      p^ W"^8H  V^ 8H  ,          &   W) P                  4       ,          V P                  P                  4       ,           # ))Úmemory_format)	r'   Ú_validate_sampler   r   Úcloner"   Úcontiguous_formatrf   re   )r/   r2   r   s   && r   Úlog_probÚGeometric.log_prob„   sy   € Ø××ÐØ×!Ñ! %Ô(Ü$ U¯J©JÓ7‰ˆØ—‘¬%×*AÑ*A�ÓBˆØ-.ˆ˜‰z˜e q™jÕ)Ñ*Ø˜—~‘~Ó'Õ'¨$¯*©*¯.©.Ó*:Õ:Ð:r   c                óh   € \        V P                  V P                  R R7      V P                  ,          # )Únone)Ú	reduction)r   r   r   rC   s   &r   ÚentropyÚGeometric.entropyŒ   s(   € ä,¨T¯[©[¸$¿*¹*ÐPVÔWØ�j‰jõð	
r   )r   r   )NNNrH   )r+   Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   Úunit_intervalÚrealÚarg_constraintsÚnonnegative_integerÚsupportr&   r:   ÚpropertyrD   rJ   rN   r   r   r   r"   r#   rj   rq   rv   Ú__static_attributes__Ú__classdictcell__Ú__classcell__)r5   r   s   @@r   r   r      sÄ   ù‡ € ñð4  × 9Ñ 9¸8À[×EUÑEUÐV€OØ×-Ñ-€G÷%õ %÷N	ð ÷&ó ð&ð ÷,ó ð,ð ÷5ó ð5ð ÷;ó ð;ð ÷<ó ð<ð #(§*¢*£,ô 
=ò;÷
ò 
r   )r"   r   Útorch.distributionsr   Ú torch.distributions.distributionr   Útorch.distributions.utilsr   r   r	   r
   Útorch.nn.functionalr   Útorch.typesr   r   Ú__all__r   © r   r   Ú<module>rŒ      s=   ðó Ý Ý +Ý 9÷ó õ Aß 'ð ˆ-€ô|
�ö |
r   