+
    &j3                         ^ RI t ^ RIHu Ht ^ RI Ht ^ RIHt ^ RIH	t	 ^ RI
Ht ^ RIHtHtHtHt R.t ! R R]	4      tR# )	    NTensor)constraints)DistributionGamma)broadcast_alllazy_propertylogits_to_probsprobs_to_logitsNegativeBinomialc                     a a ] tR t^t oRtR]P                  ! ^ 4      R]P                  ! RR4      R]P                  /t	]P                  tRV3R lV 3R llltRV 3R	 lltR
 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]V3R lR l4       t]V3R lR l4       t]P2                  ! 4       3R ltR tRtVtV ;t# )r   aC  
Creates a Negative Binomial distribution, i.e. distribution
of the number of successful independent and identical Bernoulli trials
before :attr:`total_count` failures are achieved. The probability
of success of each Bernoulli trial is :attr:`probs`.

Args:
    total_count (float or Tensor): non-negative number of negative Bernoulli
        trials to stop, although the distribution is still valid for real
        valued count
    probs (Tensor): Event probabilities of success in the half open interval [0, 1)
    logits (Tensor): Event log-odds for probabilities of success
total_countprobs              ?logitsc          
      p   < V ^8  d   QhRS[ S[,          RS[ R,          RS[ R,          RS[R,          RR/# )   r   r   Nr   validate_argsreturn)r   floatbool)format__classdict__s   "}/Users/jameslopez/projects/CWCArchive/cwc-podcast/.venv/lib/python3.14/site-packages/torch/distributions/negative_binomial.py__annotate__NegativeBinomial.__annotate__+   sT     C Ce^C }C 	C
 d{C 
C    c                  < VR J VR J 8X  d   \        R4      hVeD   \        W4      w  V n        V n        V P                  P	                  V P                  4      V n        MQVf   \        R4      h\        W4      w  V n        V n        V P                  P	                  V P                  4      V n        Ve   V P                  MV P                  V n        V P                  P                  4       p\        SV `)  WTR7       R # )Nz;Either `probs` or `logits` must be specified, but not both.zlogits is unexpectedly Noner   )
ValueErrorr	   r   r   type_asAssertionErrorr   _paramsizesuper__init__)selfr   r   r   r   batch_shape	__class__s   &&&&& r   r(   NegativeBinomial.__init__+   s     TMv~.M  
 k1	 
#//77

CD~$%BCC
 k2	 #//77DD$)$5djj4;;kk&&(Br   c                  < V P                  \        V4      p\        P                  ! V4      pV P                  P                  V4      Vn        R V P                  9   d2   V P                  P                  V4      Vn        VP                  Vn        RV P                  9   d2   V P                  P                  V4      Vn	        VP                  Vn        \        \        V`/  VRR7       V P                  Vn        V# )r   r   Fr!   )_get_checked_instancer   torchSizer   expand__dict__r   r%   r   r'   r(   _validate_args)r)   r*   	_instancenewr+   s   &&& r   r1   NegativeBinomial.expandK   s    (()99Ejj-**11+>dmm#

))+6CICJt}}$++K8CJCJ-k-O!00
r   c                :    V P                   P                  ! V/ VB # N)r%   r5   )r)   argskwargss   &*,r   _newNegativeBinomial._newY   s    {{///r   c                    < V ^8  d   QhRS[ /# r   r   r   )r   r   s   "r   r   r   ]   s     9 9f 9r   c                d    V P                   \        P                  ! V P                  4      ,          # r8   )r   r/   expr   r)   s   &r   meanNegativeBinomial.mean\   s     %))DKK"888r   c                    < V ^8  d   QhRS[ /# r>   r   )r   r   s   "r   r   r   a   s     S Sf Sr   c                    V P                   ^,
          V P                  P                  4       ,          P                  4       P	                  RR7      # )   r   )min)r   r   r@   floorclamprA   s   &r   modeNegativeBinomial.mode`   s:    !!A%)::AACIIcIRRr   c                    < V ^8  d   QhRS[ /# r>   r   )r   r   s   "r   r   r   e   s     7 7& 7r   c                f    V P                   \        P                  ! V P                  ) 4      ,          # r8   )rB   r/   sigmoidr   rA   s   &r   varianceNegativeBinomial.varianced   s     yy5==$++666r   c                    < V ^8  d   QhRS[ /# r>   r   )r   r   s   "r   r   r   i   s     ; ; ;r   c                0    \        V P                  R R7      # T)	is_binary)r   r   rA   s   &r   r   NegativeBinomial.logitsh   s    tzzT::r   c                    < V ^8  d   QhRS[ /# r>   r   )r   r   s   "r   r   r   m   s     < <v <r   c                0    \        V P                  R R7      # rS   )r   r   rA   s   &r   r   NegativeBinomial.probsl   s    t{{d;;r   c                4   < V ^8  d   QhRS[ P                  /# r>   )r/   r0   )r   r   s   "r   r   r   q   s     " "UZZ "r   c                6    V P                   P                  4       # r8   )r%   r&   rA   s   &r   param_shapeNegativeBinomial.param_shapep   s    {{!!r   c                    < V ^8  d   QhRS[ /# r>   r   )r   r   s   "r   r   r   u   s     
 
 
r   c                p    \        V P                  \        P                  ! V P                  ) 4      R R7      # )F)concentrationrater   )r   r   r/   r@   r   rA   s   &r   _gammaNegativeBinomial._gammat   s/     **DKK<(
 	
r   c                    \         P                  ! 4       ;_uu_ 4        V P                  P                  VR 7      p\         P                  ! V4      uuRRR4       #   + '       g   i     R# ; i))sample_shapeN)r/   no_gradra   samplepoisson)r)   rd   r`   s   && r   rf   NegativeBinomial.sample}   s<    ]]__;;%%<%@D==& ___s   2AA,	c                >   V P                   '       d   V P                  V4       V P                  \        P                  ! V P
                  ) 4      ,          V\        P                  ! V P
                  4      ,          ,           p\        P                  ! V P                  V,           4      ) \        P                  ! R V,           4      ,           \        P                  ! V P                  4      ,           pVP                  V P                  V,           R8H  R4      pW#,
          # )r   r   )	r3   _validate_sampler   F
logsigmoidr   r/   lgammamasked_fill)r)   valuelog_unnormalized_problog_normalizations   &&  r   log_probNegativeBinomial.log_prob   s    !!%( $ 0 01<<[[L4
 !
ALL--!.
 \\$**U233ll3;'(ll4++,- 	 .99u$+S
 %88r   )r%   r   r   r   )NNNr8   )__name__
__module____qualname____firstlineno____doc__r   greater_than_eqhalf_open_intervalrealarg_constraintsnonnegative_integersupportr(   r1   r;   propertyrB   rJ   rO   r
   r   r   r[   ra   r/   r0   rf   rr   __static_attributes____classdictcell____classcell__)r+   r   s   @@r   r   r      s      	{2215//S9+""O
 --GC C@0 9 9 S S 7 7 ; ; < < " " 
 
 #(**, '
9 9r   )r/   torch.nn.functionalnn
functionalrk   r   torch.distributionsr    torch.distributions.distributionr   torch.distributions.gammar   torch.distributions.utilsr	   r
   r   r   __all__r    r   r   <module>r      s>        + 9 +  
B9| B9r   