o
    h                     @   sN   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 deZ
dS )    )OptionalUnion)Tensor)constraints)GammaChi2c                       sh   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dZd fdd		Zedefd
dZ  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                    s   t  jd| d|d d S )Ng      ?)r	   )super__init__)selfr   r	   	__class__ ^/home/www/facesmatcher.com/frenv_anti/lib/python3.10/site-packages/torch/distributions/chi2.pyr      s   zChi2.__init__c                    s   |  t|}t ||S N)Z_get_checked_instancer   r   expand)r   Zbatch_shapeZ	_instancenewr   r   r   r   %   s   zChi2.expandc                 C   s
   | j d S )N   )Zconcentration)r   r   r   r   r   )   s   
zChi2.dfr   )__name__
__module____qualname____doc__r   ZpositiveZarg_constraintsr   r   floatr   boolr   r   propertyr   __classcell__r   r   r   r   r      s    

N)typingr   r   Ztorchr   Ztorch.distributionsr   Ztorch.distributions.gammar   __all__r   r   r   r   r   <module>   s   