+
    –°³j[  ã                   ón   € ^ RI t ^ RI HtHt ^ RIHtHt ^ RIHt ^ RIH	t	 ^ RI
Ht R.t ! R R]	4      tR# )	é    N)ÚinfÚTensor)ÚCategoricalÚconstraints)ÚBinomial)ÚDistribution)Úbroadcast_allÚMultinomialc                   ó’  a a€ ] tR t^t oRtR]P                  R]P                  /t]	V3R lR l4       t
]	V3R lR l4       tRV3R lV 3R	 llltRV 3R
 lltR t]P                  ! R^R7      R 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V3R ltRtVtV ;t# )r
   að  
Creates a Multinomial distribution parameterized by :attr:`total_count` and
either :attr:`probs` or :attr:`logits` (but not both). The innermost dimension of
:attr:`probs` indexes over categories. All other dimensions index over batches.

Note that :attr:`total_count` need not be specified if only :meth:`log_prob` is
called (see example below)

.. note:: The `probs` argument must be non-negative, finite and have a non-zero sum,
          and it will be normalized to sum to 1 along the last dimension. :attr:`probs`
          will return this normalized value.
          The `logits` argument will be interpreted as unnormalized log probabilities
          and can therefore be any real number. It will likewise be normalized so that
          the resulting probabilities sum to 1 along the last dimension. :attr:`logits`
          will return this normalized value.

-   :meth:`sample` requires a single shared `total_count` for all
    parameters and samples.
-   :meth:`log_prob` allows different `total_count` for each parameter and
    sample.

Example::

    >>> # xdoctest: +SKIP("FIXME: found invalid values")
    >>> m = Multinomial(100, torch.tensor([ 1., 1., 1., 1.]))
    >>> x = m.sample()  # equal probability of 0, 1, 2, 3
    tensor([ 21.,  24.,  30.,  25.])

    >>> Multinomial(probs=torch.tensor([1., 1., 1., 1.])).log_prob(x)
    tensor([-4.1338])

Args:
    total_count (int): number of trials
    probs (Tensor): event probabilities
    logits (Tensor): event log probabilities (unnormalized)
ÚprobsÚlogitsc                ó    <€ V ^8„  d   QhRS[ /# ©é   Úreturn©r   )ÚformatÚ__classdict__s   "€Ú`/home/luca/screen-checking/.venv/lib/python3.14/site-packages/torch/distributions/multinomial.pyÚ__annotate__ÚMultinomial.__annotate__9   s   ø€ ÷ -ñ -‘fñ -ó    c                ó<   € V P                   V P                  ,          # ©N)r   Útotal_count©Úselfs   &r   ÚmeanÚMultinomial.mean8   s   € à�z‰z˜D×,Ñ,Õ,Ð,r   c                ó    <€ V ^8„  d   QhRS[ /# r   r   )r   r   s   "€r   r   r   =   s   ø€ ÷ @ñ @™&ñ @r   c                ól   € V P                   V P                  ,          ^V P                  ,
          ,          # )é   ©r   r   r   s   &r   ÚvarianceÚMultinomial.variance<   s$   € à×Ñ $§*¡*Õ,°°D·J±JµÕ?Ð?r   c          
      ó`   <€ V ^8„  d   QhRS[ RS[R,          RS[R,          RS[R,          RR/# )r   r   r   Nr   Úvalidate_argsr   )Úintr   Úbool)r   r   s   "€r   r   r   @   sP   ø€ ÷ Pñ PáðPñ ˜�}ðPñ ˜•ð	Pñ
 ˜d•{ðPð 
ñPr   c                ó.  <€ \        V\        4      '       g   \        R 4      hWn        \	        W#R7      V n        \        WP                  R7      V n        V P
                  P                  pV P
                  P                  RR p\        SV `1  WVVR7       R# )z*inhomogeneous total_count is not supported)r   r   r#   N©r'   éÿÿÿÿ)Ú
isinstancer(   ÚNotImplementedErrorr   r   Ú_categoricalr   r   Ú	_binomialÚbatch_shapeÚparam_shapeÚsuperÚ__init__)r   r   r   r   r'   r1   Úevent_shapeÚ	__class__s   &&&&&  €r   r4   ÚMultinomial.__init__@   s|   ø€ ô ˜+¤s×+Ò+Ü%Ð&RÓSÐSØ&ÔÜ'¨eÔCˆÔÜ!¨kÇÁÔLˆŒØ×'Ñ'×3Ñ3ˆØ×'Ñ'×3Ñ3°B°CÐ8ˆä‰Ñ˜ÀÐÖOr   c                ó"  <€ V P                  \        V4      p\        P                  ! V4      pV P                  Vn        V P
                  P                  V4      Vn        \        \        V`#  WP                  R R7       V P                  Vn
        V# )Fr+   )Ú_get_checked_instancer
   ÚtorchÚSizer   r/   Úexpandr3   r4   r5   Ú_validate_args)r   r1   Ú	_instanceÚnewr6   s   &&& €r   r<   ÚMultinomial.expandQ   s}   ø€ Ø×(Ñ(¬°iÓ@ˆÜ—j’j Ó-ˆØ×*Ñ*ˆŒØ×,Ñ,×3Ñ3°KÓ@ˆÔÜŒk˜3Ñ(Ø×)Ñ)¸ð 	)ô 	
ð "×0Ñ0ˆÔØˆ
r   c                ó:   € V P                   P                  ! V/ VB # r   )r/   Ú_new)r   ÚargsÚkwargss   &*,r   rB   ÚMultinomial._new\   s   € Ø× Ñ ×%Ò% tÐ6¨vÑ6Ð6r   T)Úis_discreteÚ	event_dimc                óB   € \         P                  ! V P                  4      # r   )r   Úmultinomialr   r   s   &r   ÚsupportÚMultinomial.support_   s   € ô ×&Ò& t×'7Ñ'7Ó8Ð8r   c                ó    <€ V ^8„  d   QhRS[ /# r   r   )r   r   s   "€r   r   r   e   s   ø€ ÷ (ñ (™ñ (r   c                ó.   € V P                   P                  # r   )r/   r   r   s   &r   r   ÚMultinomial.logitsd   s   € à× Ñ ×'Ñ'Ð'r   c                ó    <€ V ^8„  d   QhRS[ /# r   r   )r   r   s   "€r   r   r   i   s   ø€ ÷ 'ñ '‘vñ 'r   c                ó.   € V P                   P                  # r   )r/   r   r   s   &r   r   ÚMultinomial.probsh   s   € à× Ñ ×&Ñ&Ð&r   c                ó4   <€ V ^8„  d   QhRS[ P                  /# r   )r:   r;   )r   r   s   "€r   r   r   m   s   ø€ ÷ -ñ -™UŸZ™Zñ -r   c                ó.   € V P                   P                  # r   )r/   r2   r   s   &r   r2   ÚMultinomial.param_shapel   s   € à× Ñ ×,Ñ,Ð,r   c                ó4  € \         P                  ! V4      pV P                  P                  \         P                  ! V P                  34      V,           4      p\        \        VP                  4       4      4      pVP                  VP                  ^ 4      4       VP                  ! V!  pVP                  V P                  V4      4      P                  4       pVP                  RV\         P                  ! V4      4       VP!                  V P"                  4      # )r   r,   )r:   r;   r/   Úsampler   ÚlistÚrangeÚdimÚappendÚpopÚpermuter?   Ú_extended_shapeÚzero_Úscatter_add_Ú	ones_likeÚtype_asr   )r   Úsample_shapeÚsamplesÚshifted_idxÚcountss   &&   r   rV   ÚMultinomial.samplep   sÌ   € Ü—z’z ,Ó/ˆØ×#Ñ#×*Ñ*Ü�JŠJ˜×(Ñ(Ð*Ó+¨lÕ:ó
ˆô
 œ5 §¡£Ó/Ó0ˆØ×Ñ˜;Ÿ?™?¨1Ó-Ô.Ø—/’/ ;Ñ/ˆØ—‘˜T×1Ñ1°,Ó?Ó@×FÑFÓHˆØ×Ñ˜B ¬¯ª¸Ó)AÔBØ�~‰~˜dŸj™jÓ)Ð)r   c                óê  € \         P                  ! V P                  4      pV P                  P	                  4       pW,          \         P
                  ! V^,           4      ,
          pV P                  P                  RR7      R,          p\         P                  ! V P                  P                  V4      4      p\         P
                  ! V^,           4      pWV,          P                  ^ R.4      pW7,           # )r"   F)r<   :r"   NNr,   )r:   Útensorr   r/   ÚentropyÚlgammar0   Úenumerate_supportÚexpÚlog_probÚsum)r   ÚnÚcat_entropyÚterm1rJ   Úbinomial_probsÚweightsÚterm2s   &       r   ri   ÚMultinomial.entropy~   s­   € Ü�LŠL˜×)Ñ)Ó*ˆà×'Ñ'×/Ñ/Ó1ˆØ•¤%§,¢,¨q°1­uÓ"5Õ5ˆà—.‘.×2Ñ2¸%Ð2Ó@ÀÕDˆÜŸš 4§>¡>×#:Ñ#:¸7Ó#CÓDˆÜ—,’,˜w¨�{Ó+ˆØÕ)×.Ñ.°°2¨wÓ7ˆà�}Ðr   c                óà  € V P                   '       d   V P                  V4       \        V P                  V4      w  r!VP	                  \
        P                  R 7      p\
        P                  ! VP                  R4      ^,           4      p\
        P                  ! V^,           4      P                  R4      p^ W!^ 8H  V\        ) 8H  ,          &   W!,          P                  R4      pW4,
          V,           # ))Úmemory_formatr,   )
r=   Ú_validate_sampler	   r   Úcloner:   Úcontiguous_formatrj   rn   r   )r   Úvaluer   Úlog_factorial_nÚlog_factorial_xsÚ
log_powerss   &&    r   rm   ÚMultinomial.log_prob‹   s´   € Ø××ÐØ×!Ñ! %Ô(Ü% d§k¡k°5Ó9‰ˆØ—‘¬E×,CÑ,C�ÓDˆÜŸ,š, u§y¡y°£}°qÕ'8Ó9ˆÜ Ÿ<š<¨°­	Ó2×6Ñ6°rÓ:ÐØ23ˆ˜‘
˜v¬#¨™~Õ.Ñ/Ø•n×)Ñ)¨"Ó-ˆ
ØÕ1°JÕ>Ð>r   c                ó&   <€ V ^8„  d   Qh/ S[ ;R&   # )r   r   )r(   )r   r   s   "€r   r   r      s   ø‡ ‚ ñP ÑòQ r   )r0   r/   r   )r"   NNNr   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   ÚsimplexÚreal_vectorÚarg_constraintsÚpropertyr   r$   r4   r<   rB   Údependent_propertyrJ   r   r   r2   r:   r;   rV   ri   rm   Ú__annotate_func__Ú__static_attributes__Ú__classdictcell__Ú__classcell__)r6   r   s   @@r   r
   r
      sç   ù‡ € ñ#ðL  × 3Ñ 3°X¸{×?VÑ?VÐW€Oð ÷-ó ð-ð ÷@ó ð@÷Põ P÷"	ò7ð ×#Ò#°ÀÔBñ9ó Cð9ð ÷(ó ð(ð ÷'ó ð'ð ÷-ó ð-ð #(§*¢*£,ô *òò	?÷{ … r   )r:   r   r   Útorch.distributionsr   r   Útorch.distributions.binomialr   Ú torch.distributions.distributionr   Útorch.distributions.utilsr	   Ú__all__r
   © r   r   Ú<module>r•      s0   ðó ß ß 8Ý 1Ý 9Ý 3ð ˆ/€ôF?�,ö F?r   