
    `i	                     ^    d dl Z e j        dk     rd dlmZ n	d dlmc mZ d dlZd dlm	Z	 d Z
dS )    N2)index_tricks)internalc                    |j         }t          j        ||          }t          j        ||d          }t          j        |j        dd                   }d |D             }	 t          |          }n# t          $ r t          d          w xY w | ||         g|R i |}	t          j        |	          }	t          j        |j        dd         |	j        z   |	j                  }
|	|
|<   |D ]+} | ||         g|R i |}t          j        |          |
|<   ,t          |	j                   D ]}t          j        |
d|          }
|
S )a  Apply a function to 1-D slices along the given axis.

    Args:
        func1d (function (M,) -> (Nj...)): This function should accept 1-D
            arrays. It is applied to 1-D slices of ``arr`` along the specified
            axis. It must return a 1-D ``cupy.ndarray``.
        axis (integer): Axis along which ``arr`` is sliced.
        arr (cupy.ndarray (Ni..., M, Nk...)): Input array.
        args: Additional arguments for ``func1d``.
        kwargs: Additional keyword arguments for ``func1d``.

    Returns:
        cupy.ndarray: The output array. The shape of ``out`` is identical to
        the shape of ``arr``, except along the ``axis`` dimension. This
        axis is removed, and replaced with new dimensions equal to the
        shape of the return value of ``func1d``. So if ``func1d`` returns a
        scalar ``out`` will have one fewer dimensions than ``arr``.

    .. seealso:: :func:`numpy.apply_along_axis`
    Nc              3   ,   K   | ]}|t           fz   V  d S )N)Ellipsis).0inds     h/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/cupy/lib/_shape_base.py	<genexpr>z#apply_along_axis.<locals>.<genexpr>'   s)      ..#C8+......    z;Cannot apply_along_axis when any iteration dimensions are 0)ndimr   _normalize_axis_indexcupymoveaxisr   ndindexshapenextStopIteration
ValueErrorasarrayemptydtyperange)func1daxisarrargskwargsr   
inarr_viewindsind0resbuffr   outis                 r   apply_along_axisr(      s   * 8D)$55DsD"--J 
 0" 566D.....D
Dzz 
 
 
I
 
 	

 &D!
3D
3
3
3F
3
3C
,s

C :j&ss+ci7CCD DJ & &fZ_6t666v66L%%S		 38__ - -}T2t,,Ks   !A1 1B)numpy__version__	numpy.libr   numpy.lib._index_tricks_impllib_index_tricks_implr   
cupy._corer   r(    r   r   <module>r1      s    s&&&&&&&777777777       8 8 8 8 8r   