
    `i                         d dl Z ddZdS )    Nc                     t          j        | |d          }t          j        | |z
            }|t          j        ||d          z  S )a  Softmax function.

    The softmax function transforms each element of a
    collection by computing the exponential of each element
    divided by the sum of the exponentials of all the elements.

    Parameters
    ----------
    x : array-like
        The input array
    axis : int or tuple of ints, optional
        Axis to compute values along. Default is None

    Returns
    -------
    s : cupy.ndarray
        Returns an array with same shape as input. The result
        will sum to 1 along the provided axis

    T)axiskeepdims)cupyamaxexpsum)xr   x_maxexp_x_shifteds       p/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/cupyx/scipy/special/_softmax.pysoftmaxr      sI    , IadT222EHQY''M48MtLLLLL    )N)r   r    r   r   <module>r      s2    M M M M M Mr   