o
    X۷i                     @  sv   d dl mZ d dlZd dlZd dlmZ zd dl	Z
dZW n ey'   dZY nw eje Zdd Zg dZd	d
 ZdS )    )annotationsN)ndarrayTFc                  G  s0   ddl m} | D ]}t|t|frt  S qtS )a  Returns the array module for arguments.

    This function is used to implement CPU/GPU generic code. If at least one of
    the arguments is a :class:`cupy.ndarray` object, the :mod:`cupyx.scipy`
    module is returned.

    Args:
        args: Values to determine whether NumPy or CuPy should be used.

    Returns:
        module: :mod:`cupyx.scipy` or :mod:`scipy` is returned based on the
        types of the arguments.

    r   )spmatrix)cupyx.scipy.sparse._baser   
isinstance_ndarray_cupyx_scipy_scipy)args	_spmatrixarg r   J/home/ubuntu/vllm_env/lib/python3.10/site-packages/cupyx/scipy/__init__.pyget_array_module   s   r   )
fftfftpackinterpolatelinalgndimagesignalsparsespatialspecialstatsc                 C  sD   | t v rtd|  S zt |  W S  ty!   td|  dw )Nzcupyx.scipy.z'Module 'cupyx.scipy' has no attribute '')_submodules
_importlibimport_moduleglobalsKeyErrorAttributeError)namer   r   r   __getattr__0   s   
r"   )
__future__r   sys_sys	importlibr   
cupy._corer   r   scipyr	   _scipy_availableImportErrormodules__name__r   r   r   r"   r   r   r   r   <module>   s    
