
    
9j                        S SK Jr  S SKrS SKrS SKJr  S rSSSS.S jjrS rSSS.S	 jrSSS.S
 jr	SSS.S jr
SSSS.S jjrg)    )annotationsN)_corec                (   [        S U  5       5      (       a  [        S5      e[        U 5      n[        U5       HM  u  p#UR                  S:X  a  USS2[
        R                  4   nX1U'   M2  UR                  S:w  d  MD  [        S5      e   [        USS9$ )a[  Stacks 1-D and 2-D arrays as columns into a 2-D array.

A 1-D array is first converted to a 2-D column array. Then, the 2-D arrays
are concatenated along the second axis.

Args:
    tup (sequence of arrays): 1-D or 2-D arrays to be stacked.

Returns:
    cupy.ndarray: A new 2-D array of stacked columns.

.. seealso:: :func:`numpy.column_stack`

c              3  `   #    U  H$  n[        U[        R                  5      (       + v   M&     g 7f)N)
isinstancecupyndarray).0as     Q/home/wildlama/miniconda3/lib/python3.13/site-packages/cupy/_manipulation/join.py	<genexpr>column_stack.<locals>.<genexpr>   s!     
8Cqz!T\\***Cs   ,.z&Only cupy arrays can be column stacked   N   z4Only 1 or 2 dimensional arrays can be column stacked)axis)	any	TypeErrorlist	enumeratendimr   newaxis
ValueErrorconcatenate)tuplstir   s       r   column_stackr   	   s     
8C
888@AA
s)C#66Q;!T\\/"AFVVq[FH H  s##    	same_kinddtypecastingc                   Uc!  U  Vs/ s H  oUR                  5       PM     n nSn[        R                  " XX#U5      $ s  snf )u  Joins arrays along an axis.

Args:
    tup (sequence of arrays): Arrays to be joined. All of these should have
        same dimensionalities except the specified axis.
    axis (int or None): The axis to join arrays along.
        If axis is None, arrays are flattened before use.
        Default is 0.
    out (cupy.ndarray): Output array.
    dtype (str or dtype): If provided, the destination array will have this
        dtype. Cannot be provided together with ``out``.
    casting ({‘no’, ‘equiv’, ‘safe’, ‘same_kind’, ‘unsafe’}, optional):
        Controls what kind of data casting may occur. Defaults to
        ``'same_kind'``.

Returns:
    cupy.ndarray: Joined array.

.. seealso:: :func:`numpy.concatenate`

r   )ravelr   concatenate_method)r   r   outr!   r"   ms         r   r   r   '   s@    , |"%&#Qwwy#&##Cs7CC 's   =c                n    [        U  Vs/ s H  n[        R                  " U5      PM     snS5      $ s  snf )zStacks arrays along the third axis.

Args:
    tup (sequence of arrays): Arrays to be stacked. Each array is converted
        by :func:`cupy.atleast_3d` before stacking.

Returns:
    cupy.ndarray: Stacked array.

.. seealso:: :func:`numpy.dstack`

r   )r   r   
atleast_3d)r   r'   s     r   dstackr*   C   s,     C8Cq*C8!<<8s    2c                   U  Vs/ s H  n[         R                  " U5      PM     nnSnUS   R                  S:X  a  Sn[        XEXS9$ s  snf )uh  Stacks arrays horizontally.

If an input array has one dimension, then the array is treated as a
horizontal vector and stacked along the first axis. Otherwise, the array is
stacked along the second axis.

Args:
    tup (sequence of arrays): Arrays to be stacked.
    dtype (str or dtype): If provided, the destination array will have this
        dtype.
    casting ({‘no’, ‘equiv’, ‘safe’, ‘same_kind’, ‘unsafe’}, optional):
        Controls what kind of data casting may occur. Defaults to
        ``'same_kind'``.

Returns:
    cupy.ndarray: Stacked array.

.. seealso:: :func:`numpy.hstack`

r   r   r    )r   
atleast_1dr   r   )r   r!   r"   r   arrsr   s         r   hstackr.   S   sM    * ),,1DOOAD,DAw||qt@@	 -s    Ac               l    [        U  Vs/ s H  n[        R                  " U5      PM     snSXS9$ s  snf )u  Stacks arrays vertically.

If an input array has one dimension, then the array is treated as a
horizontal vector and stacked along the additional axis at the head.
Otherwise, the array is stacked along the first axis.

Args:
    tup (sequence of arrays): Arrays to be stacked. Each array is converted
        by :func:`cupy.atleast_2d` before stacking.
    dtype (str or dtype): If provided, the destination array will have this
        dtype.
    casting ({‘no’, ‘equiv’, ‘safe’, ‘same_kind’, ‘unsafe’}, optional):
        Controls what kind of data casting may occur. Defaults to
        ``'same_kind'``.

Returns:
    cupy.ndarray: Stacked array.

.. seealso:: :func:`numpy.dstack`

r   r    )r   r   
atleast_2d)r   r!   r"   r'   s       r   vstackr1   o   s3    , C8Cq*C8!"5 58    1c               J    [         R                  " S[        SS9  [        XUS9$ )Nz:`row_stack` alias is deprecated. Use `cp.vstack` directly.r   )
stacklevelr    )warningswarnDeprecationWarningr1   )r   r!   r"   s      r   	row_stackr8      s(    MM	$	 #G44r   c          	     l    [        U  Vs/ s H  n[        R                  " XQ5      PM     snXX4S9$ s  snf )uC  Stacks arrays along a new axis.

Args:
    tup (sequence of arrays): Arrays to be stacked.
    axis (int): Axis along which the arrays are stacked.
    out (cupy.ndarray): Output array.
    dtype (str or dtype): If provided, the destination array will have this
        dtype. Cannot be provided together with ``out``.
    casting ({‘no’, ‘equiv’, ‘safe’, ‘same_kind’, ‘unsafe’}, optional):
        Controls what kind of data casting may occur. Defaults to
        ``'same_kind'``.

Returns:
    cupy.ndarray: Stacked array.

.. seealso:: :func:`numpy.stack`
r    )r   r   expand_dims)r   r   r&   r!   r"   xs         r   stackr<      s5    $ 3?3a((13?"5 5?r2   )r   N)
__future__r   r5   r   r   r   r   r*   r.   r1   r8   r<    r   r   <module>r?      s^    "   $<Dk D8=  { A8 { 54 !+ 55$ 5r   