
    }Yh                     \    d dl mZmZ d dlmZ d dlmZ d dlmZ dgZ	 G d de          Z
dS )    )OptionalUnion)Tensor)constraints)GammaChi2c                        e Zd ZdZdej        iZ	 d	deee	f         de
e         ddf fdZd	 fd	Zedefd            Z xZS )
r   a  
    Creates a Chi-squared distribution parameterized by shape parameter :attr:`df`.
    This is exactly equivalent to ``Gamma(alpha=0.5*df, beta=0.5)``

    Example::

        >>> # xdoctest: +IGNORE_WANT("non-deterministic")
        >>> m = Chi2(torch.tensor([1.0]))
        >>> m.sample()  # Chi2 distributed with shape df=1
        tensor([ 0.1046])

    Args:
        df (float or Tensor): shape parameter of the distribution
    dfNvalidate_argsreturnc                 V    t                                          d|z  d|           d S )Ng      ?)r   )super__init__)selfr
   r   	__class__s      j/var/www/tools.fuzzalab.pt/emblema-extractor/venv/lib/python3.11/site-packages/torch/distributions/chi2.pyr   zChi2.__init__   s.    
 	r3mDDDDD    c                 ~    |                      t          |          }t                                          ||          S N)_get_checked_instancer   r   expand)r   batch_shape	_instancenewr   s       r   r   zChi2.expand%   s0    ((y99ww~~k3///r   c                     | j         dz  S )N   )concentration)r   s    r   r
   zChi2.df)   s    !A%%r   r   )__name__
__module____qualname____doc__r   positivearg_constraintsr   r   floatr   boolr   r   propertyr
   __classcell__)r   s   @r   r   r      s          [12O
 )-E E&%- E  ~E 
	E E E E E E0 0 0 0 0 0 &F & & & X& & & & &r   N)typingr   r   torchr   torch.distributionsr   torch.distributions.gammar   __all__r    r   r   <module>r.      s    " " " " " " " "       + + + + + + + + + + + + (& & & & &5 & & & & &r   