o
    XÛ·iz  ã                   @  sD   d dl mZ d dlZd dlmZ d dlmZ d dlmZ dd„ ZdS )é    )ÚannotationsN)Ú_digamma)Ú_gamma)Ú_zetac                 C  sR   t  | |¡\} }d| d  t | d ¡ t | d |¡ }t  | dkt |¡|¡S )a  Polygamma function n.

    Args:
        n (cupy.ndarray): The order of the derivative of `psi`.
        x (cupy.ndarray): Where to evaluate the polygamma function.

    Returns:
        cupy.ndarray: The result.

    .. seealso:: :data:`scipy.special.polygamma`

    g      ð¿é   g      ð?r   )	ÚcupyÚbroadcast_arraysr   Úgammar   ÚzetaÚwherer   Údigamma)ÚnÚxÚfac2© r   úT/home/ubuntu/vllm_env/lib/python3.10/site-packages/cupyx/scipy/special/_polygamma.pyÚ	polygamma	   s   *r   )Ú
__future__r   r   Úcupyx.scipy.specialr   r   r   r   r   r   r   r   Ú<module>   s    