
    ij
                     L    d Z ddlmZ ddlmZ  ed       G d de             Zy)z"Adaptive Average Pooling 1D layer.    )keras_export)BaseAdaptiveAveragePoolingz%keras.layers.AdaptiveAveragePooling1Dc                   $     e Zd ZdZd fd	Z xZS )AdaptiveAveragePooling1Da  Adaptive average pooling operation for 1D temporal or spatial data.

    This layer applies an adaptive average pooling operation, which pools the
    input such that the output has a target length specified by `output_size`,
    regardless of the input length. The kernel size and stride are automatically
    computed to achieve the target output size.

    Args:
        output_size: Integer specifying the target output length.
        data_format: string, either `"channels_last"` or `"channels_first"`.
            `"channels_last"` corresponds to inputs with shape
            `(batch, length, channels)`.
            `"channels_first"` corresponds to inputs with shape
            `(batch, channels, length)`.
            Defaults to the value found in your Keras config file at
            `~/.keras/keras.json`. If never set, `"channels_last"` is used.

    Input shape:
        - If `data_format="channels_last"`: 3D tensor
            `(batch_size, length, channels)`
        - If `data_format="channels_first"`: 3D tensor
            `(batch_size, channels, length)`

    Output shape:
        - If `data_format="channels_last"`:
            `(batch_size, output_length, channels)`
        - If `data_format="channels_first"`:
            `(batch_size, channels, output_length)`

    Examples:
        >>> import numpy as np
        >>> input_seq = np.random.rand(1, 64, 3)
        >>> layer = AdaptiveAveragePooling1D(output_size=32)
        >>> output_seq = layer(input_seq)
        >>> output_seq.shape
        (1, 32, 3)
    c                     t        |t              r|f}nXt        |t        t        f      r(t	        |      dk7  rt        d|       t        |      }nt        d| dt        |             t        | $  ||fi | y )N   z@For 1D input, `output_size` tuple must have length 1. Received: zB`output_size` must be an integer or tuple of 1 integer. Received: z	 of type )

isinstanceinttuplelistlen
ValueError	TypeErrortypesuper__init__)selfoutput_sizedata_formatkwargs	__class__s       /var/www/html/emotional.easysim.app/public_html/venv/lib/python3.12/site-packages/keras/src/layers/pooling/adaptive_average_pooling1d.pyr   z!AdaptiveAveragePooling1D.__init__1   s    k3'&.KeT]3;1$ !!,/   ,K(M43D2EG 
 	k<V<    )N)__name__
__module____qualname____doc__r   __classcell__)r   s   @r   r   r   	   s    $L= =r   r   N)r   keras.src.api_exportr   .keras.src.layers.pooling.base_adaptive_poolingr   r    r   r   <module>r"      s2    ( -
 567=9 7= 77=r   