o
    i e|                     @   s  d Z ddlmZ ddlmZ ddlmZ ddlZddlmZ ddl	m
Z
 ddlmZ ed	gd
G dd deje
jZedgd
			d0ddZedgd
G dd deje
jZedgd
			d0ddZedgd
G dd deje
jZedgd
			d0ddZedgd
G dd  d eje
jZed!gd
			d0d"d#Zed$gd
G d%d& d&eje
jZed'gd
			d0d(d)Zed*gd
G d+d, d,eje
jZed-gd
			d0d.d/ZeZeZeZeZdS )1z@Contains the pooling layer classes and their functional aliases.    )absolute_import)division)print_functionN)layers)base)keras_exportz1keras.__internal__.legacy.layers.AveragePooling1D)v1c                       (   e Zd ZdZ			d fdd	Z  ZS )AveragePooling1Da4  Average Pooling layer for 1D inputs.

    Args:
      pool_size: An integer or tuple/list of a single integer,
        representing the size of the pooling window.
      strides: An integer or tuple/list of a single integer, specifying the
        strides of the pooling operation.
      padding: A string. The padding method, either 'valid' or 'same'.
        Case-insensitive.
      data_format: A string, one of `channels_last` (default) or
        `channels_first`. The ordering of the dimensions in the inputs.
        `channels_last` corresponds to inputs with shape
        `(batch, length, channels)` while `channels_first` corresponds to
        inputs with shape `(batch, channels, length)`.
      name: A string, the name of the layer.


    @compatibility(TF2)
    This API is a legacy api that is only compatible with eager execution and
    `tf.function` if you combine it with
    `tf.compat.v1.keras.utils.track_tf1_style_variables`

    Please refer to [tf.layers model mapping section of the migration guide]
    (https://www.tensorflow.org/guide/migrate/model_mapping)
    to learn how to use your TensorFlow v1 model in TF2 with Keras.

    The corresponding TensorFlow v2 layer is
    `tf.keras.layers.AveragePooling1D`.


    #### Structural Mapping to Native TF2

    None of the supported arguments have changed name.

    Before:

    ```python
     pooling = tf.compat.v1.layers.AveragePooling1D(pool_size=2, strides=2)
    ```

    After:

    ```python
     pooling = tf.keras.layers.AveragePooling1D(pool_size=2, strides=2)
    ```
    @end_compatibility
    validchannels_lastNc                    2   |d u rt dt jd|||||d| d S Nz$Argument `strides` must not be None.	pool_sizestridespaddingdata_formatname 
ValueErrorsuper__init__selfr   r   r   r   r   kwargs	__class__r   Q/var/www/myenv/lib/python3.10/site-packages/keras/src/legacy_tf_layers/pooling.pyr   P      	
zAveragePooling1D.__init__r   r   N__name__
__module____qualname____doc__r   __classcell__r   r   r   r   r
          4r
   z2keras.__internal__.legacy.layers.average_pooling1dr   r   c                 C   (   t jddd t|||||d}|| S )a  Average Pooling layer for 1D inputs.

    Args:
      inputs: The tensor over which to pool. Must have rank 3.
      pool_size: An integer or tuple/list of a single integer,
        representing the size of the pooling window.
      strides: An integer or tuple/list of a single integer, specifying the
        strides of the pooling operation.
      padding: A string. The padding method, either 'valid' or 'same'.
        Case-insensitive.
      data_format: A string, one of `channels_last` (default) or
        `channels_first`. The ordering of the dimensions in the inputs.
        `channels_last` corresponds to inputs with shape
        `(batch, length, channels)` while `channels_first` corresponds to
        inputs with shape `(batch, channels, length)`.
      name: A string, the name of the layer.

    Returns:
      The output tensor, of rank 3.

    Raises:
      ValueError: if eager execution is enabled.


    @compatibility(TF2)
    This API is a legacy api that is only compatible with eager execution and
    `tf.function` if you combine it with
    `tf.compat.v1.keras.utils.track_tf1_style_variables`

    Please refer to [tf.layers model mapping section of the migration guide]
    (https://www.tensorflow.org/guide/migrate/model_mapping)
    to learn how to use your TensorFlow v1 model in TF2 with Keras.

    The corresponding TensorFlow v2 layer is
    `tf.keras.layers.AveragePooling1D`.


    #### Structural Mapping to Native TF2

    None of the supported arguments have changed name.

    Before:

    ```python
     y = tf.compat.v1.layers.average_pooling1d(x, pool_size=2, strides=2)
    ```

    After:

    To migrate code using TF1 functional layers use the [Keras Functional API]
    (https://www.tensorflow.org/guide/keras/functional):

    ```python
     x = tf.keras.Input((28, 28, 1))
     y = tf.keras.layers.AveragePooling1D(pool_size=2, strides=2)(x)
     model = tf.keras.Model(x, y)
    ```
    @end_compatibility
    z`tf.layers.average_pooling1d` is deprecated and will be removed in a future version. Please use `tf.keras.layers.AveragePooling1D` instead.   
stacklevelr   )warningswarnr
   inputsr   r   r   r   r   layerr   r   r   average_pooling1de      Dr2   z-keras.__internal__.legacy.layers.MaxPooling1Dc                       r	   )MaxPooling1Da$  Max Pooling layer for 1D inputs.

    Args:
      pool_size: An integer or tuple/list of a single integer,
        representing the size of the pooling window.
      strides: An integer or tuple/list of a single integer, specifying the
        strides of the pooling operation.
      padding: A string. The padding method, either 'valid' or 'same'.
        Case-insensitive.
      data_format: A string, one of `channels_last` (default) or
        `channels_first`. The ordering of the dimensions in the inputs.
        `channels_last` corresponds to inputs with shape
        `(batch, length, channels)` while `channels_first` corresponds to
        inputs with shape `(batch, channels, length)`.
      name: A string, the name of the layer.


    @compatibility(TF2)
    This API is a legacy api that is only compatible with eager execution and
    `tf.function` if you combine it with
    `tf.compat.v1.keras.utils.track_tf1_style_variables`

    Please refer to [tf.layers model mapping section of the migration guide]
    (https://www.tensorflow.org/guide/migrate/model_mapping)
    to learn how to use your TensorFlow v1 model in TF2 with Keras.

    The corresponding TensorFlow v2 layer is
    `tf.keras.layers.MaxPooling1D`.


    #### Structural Mapping to Native TF2

    None of the supported arguments have changed name.

    Before:

    ```python
     pooling = tf.compat.v1.layers.MaxPooling1D(pool_size=2, strides=2)
    ```

    After:

    ```python
     pooling = tf.keras.layers.MaxPooling1D(pool_size=2, strides=2)
    ```
    @end_compatibility
    r   r   Nc                    r   r   r   r   r   r   r   r      r    zMaxPooling1D.__init__r!   r"   r   r   r   r   r4      r(   r4   z.keras.__internal__.legacy.layers.max_pooling1dc                 C   r)   )a  Max Pooling layer for 1D inputs.

    Args:
      inputs: The tensor over which to pool. Must have rank 3.
      pool_size: An integer or tuple/list of a single integer,
        representing the size of the pooling window.
      strides: An integer or tuple/list of a single integer, specifying the
        strides of the pooling operation.
      padding: A string. The padding method, either 'valid' or 'same'.
        Case-insensitive.
      data_format: A string, one of `channels_last` (default) or
        `channels_first`. The ordering of the dimensions in the inputs.
        `channels_last` corresponds to inputs with shape
        `(batch, length, channels)` while `channels_first` corresponds to
        inputs with shape `(batch, channels, length)`.
      name: A string, the name of the layer.

    Returns:
      The output tensor, of rank 3.

    Raises:
      ValueError: if eager execution is enabled.


    @compatibility(TF2)
    This API is a legacy api that is only compatible with eager execution and
    `tf.function` if you combine it with
    `tf.compat.v1.keras.utils.track_tf1_style_variables`

    Please refer to [tf.layers model mapping section of the migration guide]
    (https://www.tensorflow.org/guide/migrate/model_mapping)
    to learn how to use your TensorFlow v1 model in TF2 with Keras.

    The corresponding TensorFlow v2 layer is
    `tf.keras.layers.MaxPooling1D`.


    #### Structural Mapping to Native TF2

    None of the supported arguments have changed name.

    Before:

    ```python
     y = tf.compat.v1.layers.max_pooling1d(x, pool_size=2, strides=2)
    ```

    After:

    To migrate code using TF1 functional layers use the [Keras Functional API]
    (https://www.tensorflow.org/guide/keras/functional):

    ```python
     x = tf.keras.Input((28, 28, 1))
     y = tf.keras.layers.MaxPooling1D(pool_size=2, strides=2)(x)
     model = tf.keras.Model(x, y)
    ```
    @end_compatibility
    z`tf.layers.max_pooling1d` is deprecated and will be removed in a future version. Please use `tf.keras.layers.MaxPooling1D` instead.r*   r+   r   )r-   r.   r4   r/   r   r   r   max_pooling1d   r3   r5   z1keras.__internal__.legacy.layers.AveragePooling2Dc                       r	   )AveragePooling2Da   Average pooling layer for 2D inputs (e.g. images).

    Args:
      pool_size: An integer or tuple/list of 2 integers: (pool_height,
        pool_width) specifying the size of the pooling window.
        Can be a single integer to specify the same value for
        all spatial dimensions.
      strides: An integer or tuple/list of 2 integers,
        specifying the strides of the pooling operation.
        Can be a single integer to specify the same value for
        all spatial dimensions.
      padding: A string. The padding method, either 'valid' or 'same'.
        Case-insensitive.
      data_format: A string. The ordering of the dimensions in the inputs.
        `channels_last` (default) and `channels_first` are supported.
        `channels_last` corresponds to inputs with shape
        `(batch, height, width, channels)` while `channels_first` corresponds to
        inputs with shape `(batch, channels, height, width)`.
      name: A string, the name of the layer.


    @compatibility(TF2)
    This API is a legacy api that is only compatible with eager execution and
    `tf.function` if you combine it with
    `tf.compat.v1.keras.utils.track_tf1_style_variables`

    Please refer to [tf.layers model mapping section of the migration guide]
    (https://www.tensorflow.org/guide/migrate/model_mapping)
    to learn how to use your TensorFlow v1 model in TF2 with Keras.

    The corresponding TensorFlow v2 layer is
    `tf.keras.layers.AveragePooling2D`.


    #### Structural Mapping to Native TF2

    None of the supported arguments have changed name.

    Before:

    ```python
     pooling = tf.compat.v1.layers.AveragePooling2D(pool_size=2, strides=2)
    ```

    After:

    ```python
     pooling = tf.keras.layers.AveragePooling2D(pool_size=2, strides=2)
    ```
    @end_compatibility
    r   r   Nc                    r   r   r   r   r   r   r   r     r    zAveragePooling2D.__init__r!   r"   r   r   r   r   r6   T      8r6   z2keras.__internal__.legacy.layers.average_pooling2dc                 C   r)   )a  Average pooling layer for 2D inputs (e.g. images).

    Args:
      inputs: The tensor over which to pool. Must have rank 4.
      pool_size: An integer or tuple/list of 2 integers: (pool_height,
        pool_width) specifying the size of the pooling window.
        Can be a single integer to specify the same value for
        all spatial dimensions.
      strides: An integer or tuple/list of 2 integers,
        specifying the strides of the pooling operation.
        Can be a single integer to specify the same value for
        all spatial dimensions.
      padding: A string. The padding method, either 'valid' or 'same'.
        Case-insensitive.
      data_format: A string. The ordering of the dimensions in the inputs.
        `channels_last` (default) and `channels_first` are supported.
        `channels_last` corresponds to inputs with shape
        `(batch, height, width, channels)` while `channels_first` corresponds to
        inputs with shape `(batch, channels, height, width)`.
      name: A string, the name of the layer.

    Returns:
      Output tensor.

    Raises:
      ValueError: if eager execution is enabled.


    @compatibility(TF2)
    This API is a legacy api that is only compatible with eager execution and
    `tf.function` if you combine it with
    `tf.compat.v1.keras.utils.track_tf1_style_variables`

    Please refer to [tf.layers model mapping section of the migration guide]
    (https://www.tensorflow.org/guide/migrate/model_mapping)
    to learn how to use your TensorFlow v1 model in TF2 with Keras.

    The corresponding TensorFlow v2 layer is
    `tf.keras.layers.AveragePooling2D`.


    #### Structural Mapping to Native TF2

    None of the supported arguments have changed name.

    Before:

    ```python
     y = tf.compat.v1.layers.average_pooling2d(x, pool_size=2, strides=2)
    ```

    After:

    To migrate code using TF1 functional layers use the [Keras Functional API]
    (https://www.tensorflow.org/guide/keras/functional):

    ```python
     x = tf.keras.Input((28, 28, 1))
     y = tf.keras.layers.AveragePooling2D(pool_size=2, strides=2)(x)
     model = tf.keras.Model(x, y)
    ```
    @end_compatibility
    z`tf.layers.average_pooling2d` is deprecated and will be removed in a future version. Please use `tf.keras.layers.AveragePooling2D` instead.r*   r+   r   )r-   r.   r6   r/   r   r   r   average_pooling2d     Hr8   z-keras.__internal__.legacy.layers.MaxPooling2Dc                       r	   )MaxPooling2Da  Max pooling layer for 2D inputs (e.g. images).

    Args:
      pool_size: An integer or tuple/list of 2 integers: (pool_height,
        pool_width) specifying the size of the pooling window.
        Can be a single integer to specify the same value for
        all spatial dimensions.
      strides: An integer or tuple/list of 2 integers,
        specifying the strides of the pooling operation.
        Can be a single integer to specify the same value for
        all spatial dimensions.
      padding: A string. The padding method, either 'valid' or 'same'.
        Case-insensitive.
      data_format: A string. The ordering of the dimensions in the inputs.
        `channels_last` (default) and `channels_first` are supported.
        `channels_last` corresponds to inputs with shape
        `(batch, height, width, channels)` while `channels_first` corresponds to
        inputs with shape `(batch, channels, height, width)`.
      name: A string, the name of the layer.


    @compatibility(TF2)
    This API is a legacy api that is only compatible with eager execution and
    `tf.function` if you combine it with
    `tf.compat.v1.keras.utils.track_tf1_style_variables`

    Please refer to [tf.layers model mapping section of the migration guide]
    (https://www.tensorflow.org/guide/migrate/model_mapping)
    to learn how to use your TensorFlow v1 model in TF2 with Keras.

    The corresponding TensorFlow v2 layer is
    `tf.keras.layers.MaxPooling2D`.


    #### Structural Mapping to Native TF2

    None of the supported arguments have changed name.

    Before:

    ```python
     pooling = tf.compat.v1.layers.MaxPooling2D(pool_size=2, strides=2)
    ```

    After:

    ```python
     pooling = tf.keras.layers.MaxPooling2D(pool_size=2, strides=2)
    ```
    @end_compatibility
    r   r   Nc                    r   r   r   r   r   r   r   r   -  r    zMaxPooling2D.__init__r!   r"   r   r   r   r   r:     r7   r:   z.keras.__internal__.legacy.layers.max_pooling2dc                 C   r)   )a{  Max pooling layer for 2D inputs (e.g. images).

    Args:
      inputs: The tensor over which to pool. Must have rank 4.
      pool_size: An integer or tuple/list of 2 integers: (pool_height,
        pool_width) specifying the size of the pooling window.
        Can be a single integer to specify the same value for
        all spatial dimensions.
      strides: An integer or tuple/list of 2 integers,
        specifying the strides of the pooling operation.
        Can be a single integer to specify the same value for
        all spatial dimensions.
      padding: A string. The padding method, either 'valid' or 'same'.
        Case-insensitive.
      data_format: A string. The ordering of the dimensions in the inputs.
        `channels_last` (default) and `channels_first` are supported.
        `channels_last` corresponds to inputs with shape
        `(batch, height, width, channels)` while `channels_first` corresponds to
        inputs with shape `(batch, channels, height, width)`.
      name: A string, the name of the layer.

    Returns:
      Output tensor.

    Raises:
      ValueError: if eager execution is enabled.


    @compatibility(TF2)
    This API is a legacy api that is only compatible with eager execution and
    `tf.function` if you combine it with
    `tf.compat.v1.keras.utils.track_tf1_style_variables`

    Please refer to [tf.layers model mapping section of the migration guide]
    (https://www.tensorflow.org/guide/migrate/model_mapping)
    to learn how to use your TensorFlow v1 model in TF2 with Keras.

    The corresponding TensorFlow v2 layer is
    `tf.keras.layers.MaxPooling2D`.


    #### Structural Mapping to Native TF2

    None of the supported arguments have changed name.

    Before:

    ```python
     y = tf.compat.v1.layers.max_pooling2d(x, pool_size=2, strides=2)
    ```

    After:

    To migrate code using TF1 functional layers use the [Keras Functional API]
    (https://www.tensorflow.org/guide/keras/functional):

    ```python
     x = tf.keras.Input((28, 28, 1))
     y = tf.keras.layers.MaxPooling2D(pool_size=2, strides=2)(x)
     model = tf.keras.Model(x, y)
    ```
    @end_compatibility
    z`tf.layers.max_pooling2d` is deprecated and will be removed in a future version. Please use `tf.keras.layers.MaxPooling2D` instead.r*   r+   r   )r-   r.   r:   r/   r   r   r   max_pooling2dB  r9   r;   z1keras.__internal__.legacy.layers.AveragePooling3Dc                       r	   )AveragePooling3DaK  Average pooling layer for 3D inputs (e.g. volumes).

    Args:
      pool_size: An integer or tuple/list of 3 integers:
        (pool_depth, pool_height, pool_width)
        specifying the size of the pooling window.
        Can be a single integer to specify the same value for
        all spatial dimensions.
      strides: An integer or tuple/list of 3 integers,
        specifying the strides of the pooling operation.
        Can be a single integer to specify the same value for
        all spatial dimensions.
      padding: A string. The padding method, either 'valid' or 'same'.
        Case-insensitive.
      data_format: A string. The ordering of the dimensions in the inputs.
        `channels_last` (default) and `channels_first` are supported.
        `channels_last` corresponds to inputs with shape
        `(batch, depth, height, width, channels)` while `channels_first`
        corresponds to inputs with shape
        `(batch, channels, depth, height, width)`.
      name: A string, the name of the layer.


    @compatibility(TF2)
    This API is a legacy api that is only compatible with eager execution and
    `tf.function` if you combine it with
    `tf.compat.v1.keras.utils.track_tf1_style_variables`

    Please refer to [tf.layers model mapping section of the migration guide]
    (https://www.tensorflow.org/guide/migrate/model_mapping)
    to learn how to use your TensorFlow v1 model in TF2 with Keras.

    The corresponding TensorFlow v2 layer is
    `tf.keras.layers.AveragePooling3D`.


    #### Structural Mapping to Native TF2

    None of the supported arguments have changed name.

    Before:

    ```python
     pooling = tf.compat.v1.layers.AveragePooling3D(pool_size=2, strides=2)
    ```

    After:

    ```python
     pooling = tf.keras.layers.AveragePooling3D(pool_size=2, strides=2)
    ```
    @end_compatibility
    r   r   Nc                    r   r   r   r   r   r   r   r     r    zAveragePooling3D.__init__r!   r"   r   r   r   r   r<         :r<   z2keras.__internal__.legacy.layers.average_pooling3dc                 C   r)   )a  Average pooling layer for 3D inputs (e.g. volumes).

    Args:
      inputs: The tensor over which to pool. Must have rank 5.
      pool_size: An integer or tuple/list of 3 integers:
        (pool_depth, pool_height, pool_width)
        specifying the size of the pooling window.
        Can be a single integer to specify the same value for
        all spatial dimensions.
      strides: An integer or tuple/list of 3 integers,
        specifying the strides of the pooling operation.
        Can be a single integer to specify the same value for
        all spatial dimensions.
      padding: A string. The padding method, either 'valid' or 'same'.
        Case-insensitive.
      data_format: A string. The ordering of the dimensions in the inputs.
        `channels_last` (default) and `channels_first` are supported.
        `channels_last` corresponds to inputs with shape
        `(batch, depth, height, width, channels)` while `channels_first`
        corresponds to inputs with shape
        `(batch, channels, depth, height, width)`.
      name: A string, the name of the layer.

    Returns:
      Output tensor.

    Raises:
      ValueError: if eager execution is enabled.


    @compatibility(TF2)
    This API is a legacy api that is only compatible with eager execution and
    `tf.function` if you combine it with
    `tf.compat.v1.keras.utils.track_tf1_style_variables`

    Please refer to [tf.layers model mapping section of the migration guide]
    (https://www.tensorflow.org/guide/migrate/model_mapping)
    to learn how to use your TensorFlow v1 model in TF2 with Keras.

    The corresponding TensorFlow v2 layer is
    `tf.keras.layers.AveragePooling3D`.


    #### Structural Mapping to Native TF2

    None of the supported arguments have changed name.

    Before:

    ```python
     y = tf.compat.v1.layers.average_pooling3d(x, pool_size=2, strides=2)
    ```

    After:

    To migrate code using TF1 functional layers use the [Keras Functional API]
    (https://www.tensorflow.org/guide/keras/functional):

    ```python
     x = tf.keras.Input((28, 28, 1))
     y = tf.keras.layers.AveragePooling3D(pool_size=2, strides=2)(x)
     model = tf.keras.Model(x, y)
    ```
    @end_compatibility
    z`tf.layers.average_pooling3d` is deprecated and will be removed in a future version. Please use `tf.keras.layers.AveragePooling3D` instead.r*   r+   r   )r-   r.   r<   r/   r   r   r   average_pooling3d  s   Jr>   z-keras.__internal__.legacy.layers.MaxPooling3Dc                       r	   )MaxPooling3Da;  Max pooling layer for 3D inputs (e.g. volumes).

    Args:
      pool_size: An integer or tuple/list of 3 integers:
        (pool_depth, pool_height, pool_width)
        specifying the size of the pooling window.
        Can be a single integer to specify the same value for
        all spatial dimensions.
      strides: An integer or tuple/list of 3 integers,
        specifying the strides of the pooling operation.
        Can be a single integer to specify the same value for
        all spatial dimensions.
      padding: A string. The padding method, either 'valid' or 'same'.
        Case-insensitive.
      data_format: A string. The ordering of the dimensions in the inputs.
        `channels_last` (default) and `channels_first` are supported.
        `channels_last` corresponds to inputs with shape
        `(batch, depth, height, width, channels)` while `channels_first`
        corresponds to inputs with shape
        `(batch, channels, depth, height, width)`.
      name: A string, the name of the layer.


    @compatibility(TF2)
    This API is a legacy api that is only compatible with eager execution and
    `tf.function` if you combine it with
    `tf.compat.v1.keras.utils.track_tf1_style_variables`

    Please refer to [tf.layers model mapping section of the migration guide]
    (https://www.tensorflow.org/guide/migrate/model_mapping)
    to learn how to use your TensorFlow v1 model in TF2 with Keras.

    The corresponding TensorFlow v2 layer is
    `tf.keras.layers.MaxPooling3D`.


    #### Structural Mapping to Native TF2

    None of the supported arguments have changed name.

    Before:

    ```python
     pooling = tf.compat.v1.layers.MaxPooling3D(pool_size=2, strides=2)
    ```

    After:

    ```python
     pooling = tf.keras.layers.MaxPooling3D(pool_size=2, strides=2)
    ```
    @end_compatibility
    r   r   Nc                    r   r   r   r   r   r   r   r   y  r    zMaxPooling3D.__init__r!   r"   r   r   r   r   r?   A  r=   r?   z.keras.__internal__.legacy.layers.max_pooling3dc                 C   r)   )a  Max pooling layer for 3D inputs (e.g.

    volumes).

    Args:
      inputs: The tensor over which to pool. Must have rank 5.
      pool_size: An integer or tuple/list of 3 integers: (pool_depth,
        pool_height, pool_width) specifying the size of the pooling window. Can
        be a single integer to specify the same value for all spatial
        dimensions.
      strides: An integer or tuple/list of 3 integers, specifying the strides of
        the pooling operation. Can be a single integer to specify the same value
        for all spatial dimensions.
      padding: A string. The padding method, either 'valid' or 'same'.
        Case-insensitive.
      data_format: A string. The ordering of the dimensions in the inputs.
        `channels_last` (default) and `channels_first` are supported.
        `channels_last` corresponds to inputs with shape `(batch, depth, height,
        width, channels)` while `channels_first` corresponds to inputs with
        shape `(batch, channels, depth, height, width)`.
      name: A string, the name of the layer.

    Returns:
      Output tensor.

    Raises:
      ValueError: if eager execution is enabled.


    @compatibility(TF2)
    This API is a legacy api that is only compatible with eager execution and
    `tf.function` if you combine it with
    `tf.compat.v1.keras.utils.track_tf1_style_variables`

    Please refer to [tf.layers model mapping section of the migration guide]
    (https://www.tensorflow.org/guide/migrate/model_mapping)
    to learn how to use your TensorFlow v1 model in TF2 with Keras.

    The corresponding TensorFlow v2 layer is
    `tf.keras.layers.MaxPooling3D`.


    #### Structural Mapping to Native TF2

    None of the supported arguments have changed name.

    Before:

    ```python
     y = tf.compat.v1.layers.max_pooling3d(x, pool_size=2, strides=2)
    ```

    After:

    To migrate code using TF1 functional layers use the [Keras Functional API]
    (https://www.tensorflow.org/guide/keras/functional):

    ```python
     x = tf.keras.Input((28, 28, 1))
     y = tf.keras.layers.MaxPooling3D(pool_size=2, strides=2)(x)
     model = tf.keras.Model(x, y)
    ```
    @end_compatibility
    z`tf.layers.max_pooling3d` is deprecated and will be removed in a future version. Please use `tf.keras.layers.MaxPooling3D` instead.r*   r+   r   )r-   r.   r?   r/   r   r   r   max_pooling3d  s   Ir@   r!   )r&   
__future__r   r   r   r-   	keras.srcr   keras_layerskeras.src.legacy_tf_layersr    tensorflow.python.util.tf_exportr   r
   Layerr2   r4   r5   r6   r8   r:   r;   r<   r>   r?   r@   	AvgPool2D	MaxPool2D
max_pool2d
avg_pool2dr   r   r   r   <module>   sl   

F
S
F
S
J
W
J
W
L
Y
LZ