
    `i	                     *    d dl Z d dlZd Z	 	 	 ddZdS )    Nc                 h    | dk     r!t          t          j        |                     nt          j        S )zlCompute the factorial and return as a float

    Returns infinity when result is too large for a double
       )floatmath	factorialcupyinf)ns    j/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/cupyx/scipy/_lib/_util.pyfloat_factorialr      s+    
 ()3ww5""###DH<    TFc                     |s4ddl }|j        j                            |           rd}t	          |          |r?t          j        | t
          j                  s |                     t
          j	                  } | S )a  Helper function for SciPy argument validation.

    Many CuPy linear algebra functions do support arbitrary array-like
    input arguments. Examples of commonly unsupported inputs include
    matrices containing inf/nan, sparse matrix representations, and
    matrices with complicated elements.

    Parameters
    ----------
    a : array-like
        The array-like input
    check_finite : bool, optional
        By default True. To check whether the input matrices contain
        only finite numbers. Disabling may give a performance gain,
        but may result in problems (crashes, non-termination) if the
        inputs do contain infinites or NaNs
    sparse_ok : bool, optional
        By default False. True if cupy sparse matrices are allowed
    objects_ok : bool, optional
        By default False. True if arrays with dype('O') are allowed
    mask_ok : bool, optional
        By default False. True if masked arrays are allowed.
    as_inexact : bool, optional
        By default False. True to convert the input array to a
        cupy.inexact dtype

    Returns
    -------
    ret : cupy.ndarray
        The converted validated array

    r   Nz~Sparse matrices are not supported by this function. Perhaps one of the cupyx.scipy.sparse.linalg functions would work instead.)dtype)
cupyx.scipy.sparsescipysparseissparse
ValueErrorr   
issubdtypeinexactastypefloat64)acheck_finite	sparse_ok
objects_okmask_ok
as_inexactcupyxmsgs           r   _asarray_validatedr!      s    H  "!!!!;&&q)) 	")C S//!  -q$,// 	-t|,,AHr   )TFFFF)r   r   r   r!    r   r   <module>r#      sO     = = = (,BG"'; ; ; ; ; ;r   