
    Αi
                        S SK Jr  S SKJr  S SKrS SKJrJr  S SKJ	r	  S SK
Jr  S SKJr  \(       a  S SKJrJr  S	/r " S
 S	\5      rg)    )annotations)TYPE_CHECKINGN)
check_typeconvert_dtype)Variable)Gamma)in_dynamic_mode)TensordtypeChi2c                  P   ^  \ rS rSr% SrS\S'   S\S'   S\S'   S	U 4S jjrSrU =r$ )
r      a  
Creates a Chi-squared distribution parameterized by shape parameter.
This is exactly equivalent to Gamma(concentration=0.5*df, rate=0.5), :ref:`api_paddle_distribution_Gamma`.

Args:
    df (float or Tensor): The degree of freedom of the distribution, which should be non-negative. If the input data type is Tensor, it indicates the batch creation of distributions with multiple different parameters, and the `batch_shape` (refer to the :ref:`api_paddle_distribution_Distribution` base class) is the parameter.

Example:
    .. code-block:: pycon

        >>> import paddle
        >>> m = paddle.distribution.Chi2(paddle.to_tensor([1.0]))
        >>> sample = m.sample()
        >>> sample.shape
        paddle.Size([1])

r
   dfrater   c                v  > [        5       (       d1  [        US[        [        [        R
                  R                  4S5        U R                  U5      (       a!  Xl        [        UR                  5      U l
        O2U R                  U5      u  U l        [        R                  " 5       U l
        [        R                  " U R                  S5      U l        [        5       (       a3  [        R                  " U R                  S:  5      (       d  [!        S5      e["        TU ]I  U R                  S-  U R                  5        g )Nr   r   g      ?r   z!The arg of `df` must be positive.)r	   r   floatr   paddlepirValue_validate_argsr   r   r   
_to_tensorget_default_dtype	full_liker   all
ValueErrorsuper__init__)selfr   	__class__s     X/var/www/html/banglarbhumi/venv/lib/python3.13/site-packages/paddle/distribution/chi2.pyr   Chi2.__init__6   s      &**"2"23	 r""G&rxx0DJ+ITW113DJ$$TWWc2	::dggk** !DEE3		2    )r   r   r   )r   zfloat | TensorreturnNone)	__name__
__module____qualname____firstlineno____doc____annotations__r   __static_attributes____classcell__)r   s   @r    r   r      s#    $ 	J
LL3 3r"   )
__future__r   typingr   r   paddle.base.data_feederr   r   paddle.base.frameworkr   paddle.distribution.gammar   paddle.frameworkr	   r
   r   __all__r    r"   r    <module>r5      s5    #    = * + ,$(.35 .3r"   