ó
    EñiÓ
  ã                   ód   • S SK r S SK Jr  S SKJr  S SKJr  S SKJr  S SKJ	r	  S/r
 " S S\5      rg)	é    N)ÚTensor)Úconstraints)ÚGamma)ÚTransformedDistribution)ÚPowerTransformÚInverseGammac            	       ó@  ^ • \ rS rSr% Sr\R                  \R                  S.r\R                  rSr	\
\S'    SS\\-  S\\-  S	\S-  S
S4U 4S jjjrSU 4S jjr\S
\4S j5       r\S
\4S j5       r\S
\4S j5       r\S
\4S j5       r\S
\4S j5       rS rSrU =r$ )r   é   aD  
Creates an inverse gamma distribution parameterized by :attr:`concentration` and :attr:`rate`
where::

    X ~ Gamma(concentration, rate)
    Y = 1 / X ~ InverseGamma(concentration, rate)

Example::

    >>> # xdoctest: +IGNORE_WANT("non-deterinistic")
    >>> m = InverseGamma(torch.tensor([2.0]), torch.tensor([3.0]))
    >>> m.sample()
    tensor([ 1.2953])

Args:
    concentration (float or Tensor): shape parameter of the distribution
        (often referred to as alpha)
    rate (float or Tensor): rate = 1 / scale of the distribution
        (often referred to as beta)
)ÚconcentrationÚrateTÚ	base_distNr   r   Úvalidate_argsÚreturnc                 ó‚   >• [        XUS9nUR                  R                  S5      * n[        TU ]  U[        U5      US9  g )N)r   © )r   r   Únew_onesÚsuperÚ__init__r   )Úselfr   r   r   r   Úneg_oneÚ	__class__s         €Ú^/home/mande/repo/quber/.venv/lib/python3.13/site-packages/torch/distributions/inverse_gamma.pyr   ÚInverseGamma.__init__.   sF   ø€ ô ˜-¸]ÑKˆ	Ø—>‘>×*Ñ*¨2Ó.Ð.ˆÜ‰ÑØ”~ gÓ.¸mð 	ò 	
ó    c                 óJ   >• U R                  [        U5      n[        TU ]  XS9$ )N)Ú	_instance)Ú_get_checked_instancer   r   Úexpand)r   Úbatch_shaper   Únewr   s       €r   r   ÚInverseGamma.expand:   s&   ø€ Ø×(Ñ(¬°yÓAˆÜ‰w‰~˜kˆ~Ð9Ð9r   c                 ó.   • U R                   R                  $ ©N)r   r   ©r   s    r   r   ÚInverseGamma.concentration>   s   € à�~‰~×+Ñ+Ð+r   c                 ó.   • U R                   R                  $ r#   )r   r   r$   s    r   r   ÚInverseGamma.rateB   s   € à�~‰~×"Ñ"Ð"r   c                 ó    • U R                   U R                  S-
  -  n[        R                  " U R                  S:„  U[        R                  5      $ ©Né   )r   r   ÚtorchÚwhereÚinf©r   Úresults     r   ÚmeanÚInverseGamma.meanF   s=   € à—‘˜d×0Ñ0°1Ñ4Ñ5ˆÜ�{Š{˜4×-Ñ-°Ñ1°6¼5¿9¹9ÓEÐEr   c                 ó:   • U R                   U R                  S-   -  $ r)   )r   r   r$   s    r   ÚmodeÚInverseGamma.modeK   s   € à�y‰y˜D×.Ñ.°Ñ2Ñ3Ð3r   c                 óø   • U R                   R                  5       U R                  S-
  R                  5       U R                  S-
  -  -  n[        R                  " U R                  S:„  U[        R
                  5      $ )Nr*   é   )r   Úsquarer   r+   r,   r-   r.   s     r   ÚvarianceÚInverseGamma.varianceO   sd   € à—‘×!Ñ!Ó#Ø×Ñ !Ñ#×+Ñ+Ó-°×1CÑ1CÀaÑ1GÑHñ
ˆô �{Š{˜4×-Ñ-°Ñ1°6¼5¿9¹9ÓEÐEr   c                 óÜ   • U R                   U R                  R                  5       -   U R                   R                  5       -   SU R                   -   U R                   R	                  5       -  -
  $ r)   )r   r   ÚlogÚlgammaÚdigammar$   s    r   ÚentropyÚInverseGamma.entropyV   sc   € à×ÑØ�i‰i�m‰m‹oñà× Ñ ×'Ñ'Ó)ñ*ð �4×%Ñ%Ñ%¨×);Ñ);×)CÑ)CÓ)EÑEñFð	
r   r   r#   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   ÚpositiveÚarg_constraintsÚsupportÚhas_rsampler   Ú__annotations__r   ÚfloatÚboolr   r   Úpropertyr   r   r0   r3   r8   r>   Ú__static_attributes__Ú__classcell__)r   s   @r   r   r      s  ø‡ ñð, %×-Ñ-Ø×$Ñ$ñ€Oð
 ×"Ñ"€GØ€KàÓð &*ñ	

à ‘~ð

ð �u‰nð

ð ˜d‘{ð	

ð
 
÷

ð 

÷:ð ð,˜vó ,ó ð,ð ð#�fó #ó ð#ð ðF�fó Fó ðFð ð4�fó 4ó ð4ð ðF˜&ó Fó ðF÷
ð 
r   )r+   r   Útorch.distributionsr   Útorch.distributions.gammar   Ú,torch.distributions.transformed_distributionr   Útorch.distributions.transformsr   Ú__all__r   r   r   r   Ú<module>rT      s2   ðó Ý Ý +Ý +Ý PÝ 9ð Ð
€ôN
Ð*õ N
r   