
    
9jT                    b    S SK Jr  S SKrS SKJr  SS jr\R
                  4S jrS	S jrSS jrg)
    )annotationsN)_corec                    [         R                  " XUS9n [         R                  " U 5      R                  5       (       d  [	        S5      eU $ )aj  Converts the given input to an array,
and raises an error if the input contains NaNs or Infs.

Args:
    a: array like.
    dtype: data type, optional
    order: {'C', 'F', 'A', 'K'}, optional

Returns:
    cupy.ndarray: An array on the current device.

.. note::
    This function performs device synchronization.

.. seealso:: :func:`numpy.asarray_chkfinite`

)dtypeorderz#array must not contain Infs or NaNs)cupyasarrayisfiniteall
ValueError)ar   r   s      Q/home/wildlama/miniconda3/lib/python3.13/site-packages/cupy/_manipulation/kind.pyasarray_chkfiniter      s=    & 	Q51A==!!>??H    c                    [         R                  " U[         R                  5      (       d  [         R                  n[         R                  " XS9$ )zConverts array elements to float type.

Args:
    a (cupy.ndarray): Source array.
    dtype: str or dtype object, optional

Returns:
    cupy.ndarray: The input array ``a`` as a float ndarray.

.. seealso:: :func:`numpy.asfarray`

r   )r   
issubdtypeinexactfloat64r	   r   r   s     r   asfarrayr       s1     ??5$,,//<<''r   c                .    [         R                  " X5      $ )aM  Return an array laid out in Fortran order in memory.

Args:
    a (~cupy.ndarray): The input array.
    dtype (str or dtype object, optional): By default, the data-type is
        inferred from the input data.

Returns:
    ~cupy.ndarray: The input `a` in Fortran, or column-major, order.

.. seealso:: :func:`numpy.asfortranarray`

)r   asfortranarrayr   s     r   r   r   2   s     ))r   c           
        SSSSSSSSS.nU(       d   [         R                  " XS9$  U Vs1 s H  oCUR                  5          iM     nnSnUSS1:  a  [        S	5      eSU;   a  S
nUR                  S5        OSU;   a  SnUR                  S5        SU;   a  SOSn [         R                  " XXVSS9nU$ ! [         a    [        SR	                  U5      5      ef = fs  snf ! [         aL    [        SR	                  [        U5      [        UR                  5       5      -
  R                  5       5      5      ef = f! [         a    [        SR	                  U5      5      ef = f)a  Return an array which satisfies the requirements.

Args:
    a (~cupy.ndarray): The input array.
    dtype (str or dtype object, optional): The required data-type.
        If None preserve the current dtype.
    requirements (str or list of str): The requirements can be any
        of the following

        * 'F_CONTIGUOUS' ('F', 'FORTRAN') - ensure a Fortran-contiguous                 array. 
        * 'C_CONTIGUOUS' ('C', 'CONTIGUOUS') - ensure a C-contiguous array.

        * 'OWNDATA' ('O')      - ensure an array that owns its own data.

Returns:
    ~cupy.ndarray: The input array ``a`` with specified requirements and
    type if provided.

.. seealso:: :func:`numpy.require`

CFOWNDATA)r   C_CONTIGUOUS
CONTIGUOUSr   F_CONTIGUOUSFORTRANOr   r   zIncorrect dtype "{}" providedz#Incorrect flag "{}" in requirementsAz%Cannot specify both "C" and "F" orderr    r   TNF)r   r   copysubok)r   
asanyarray	TypeErrorr   formatupperKeyErrorsetkeyspopremovearray)r   r   requirementspossible_flagsxr   r$   arrs           r   requirer4   C   s   2 3$<N 	N??122	B?KL|!17795|LL ESz!@AA		C 		C ,4$DJjjuuM J3  	N>EEeLMM	N M 	BDKK!,/!."5"5"789:=#%A B B	B$  J:AA%HIIJs4   B6 C# C	C# D< 6%CC# #AD9<%E!)NN)N)	
__future__r   r   r   r   r   r   r   r4    r   r   <module>r7      s+    "  2 ll ($*"9r   