a
    Sic~                     @   sT  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 dd	lmZ ed
gdedgdG dd deje
jZedgdedgdd=ddZedgdedgdG dd deje
jZedgdedgdd>ddZedgdedgdG dd  d eje
jZed!gded"gdd?d#d$Zed%gded&gdG d'd( d(eje
jZed)gded*gdd@d+d,Zed-gded.gdG d/d0 d0eje
jZed1gded2gddAd3d4Zed5gded6gdG d7d8 d8eje
jZed9gded:gddBd;d<ZeZeZeZeZdS )Cz@Contains the pooling layer classes and their functional aliases.    )absolute_import)division)print_functionN)layers)base)keras_export)	tf_exportz1keras.__internal__.legacy.layers.AveragePooling1D)v1zlayers.AveragePooling1Dc                       s"   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                    s2   |d u rt dt jf |||||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__ Z/var/www/html/django/DPS/env/lib/python3.9/site-packages/keras/legacy_tf_layers/pooling.pyr   R   s    	zAveragePooling1D.__init__)r   r   N__name__
__module____qualname____doc__r   __classcell__r   r   r   r   r
      s
   4   r
   z2keras.__internal__.legacy.layers.average_pooling1dzlayers.average_pooling1dr   r   c                 C   s(   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_pooling1dg   s    Er-   z-keras.__internal__.legacy.layers.MaxPooling1Dzlayers.MaxPooling1Dc                       s"   e Zd ZdZd fdd	Z  ZS )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                    s2   |d u rt dt jf |||||d| d S r   r   r   r   r   r   r      s    	zMaxPooling1D.__init__)r   r   Nr   r   r   r   r   r.      s
   4   r.   z.keras.__internal__.legacy.layers.max_pooling1dzlayers.max_pooling1dc                 C   s(   t jddd t|||||d}|| S )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)   r.   r*   r   r   r   max_pooling1d  s    Er/   z1keras.__internal__.legacy.layers.AveragePooling2Dzlayers.AveragePooling2Dc                       s"   e Zd ZdZd fdd	Z  ZS )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                    s2   |d u rt dt jf |||||d| d S r   r   r   r   r   r   r     s    	zAveragePooling2D.__init__)r   r   Nr   r   r   r   r   r0   Y  s
   8   r0   z2keras.__internal__.legacy.layers.average_pooling2dzlayers.average_pooling2dc                 C   s(   t jddd t|||||d}|| S )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)   r0   r*   r   r   r   average_pooling2d  s    Ir1   z-keras.__internal__.legacy.layers.MaxPooling2Dzlayers.MaxPooling2Dc                       s"   e Zd ZdZd fdd	Z  ZS )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                    s2   |d u rt dt jf |||||d| d S r   r   r   r   r   r   r   5  s    	zMaxPooling2D.__init__)r   r   Nr   r   r   r   r   r2     s
   8   r2   z.keras.__internal__.legacy.layers.max_pooling2dzlayers.max_pooling2dc                 C   s(   t jddd t|||||d}|| S )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)   r2   r*   r   r   r   max_pooling2dJ  s    Ir3   z1keras.__internal__.legacy.layers.AveragePooling3Dzlayers.AveragePooling3Dc                       s"   e Zd ZdZd fdd	Z  ZS )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                    s2   |d u rt dt jf |||||d| d S r   r   r   r   r   r   r     s    	zAveragePooling3D.__init__)r   r   Nr   r   r   r   r   r4     s
   :   r4   z2keras.__internal__.legacy.layers.average_pooling3dzlayers.average_pooling3dc                 C   s(   t jddd t|||||d}|| S )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)   r4   r*   r   r   r   average_pooling3d  s    Kr5   z-keras.__internal__.legacy.layers.MaxPooling3Dzlayers.MaxPooling3Dc                       s"   e Zd ZdZd fdd	Z  ZS )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                    s2   |d u rt dt jf |||||d| d S r   r   r   r   r   r   r     s    	zMaxPooling3D.__init__)r   r   Nr   r   r   r   r   r6   L  s
   :   r6   z.keras.__internal__.legacy.layers.max_pooling3dzlayers.max_pooling3dc                 C   s(   t jddd t|||||d}|| S )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)   r6   r*   r   r   r   max_pooling3d  s    Jr7   )r   r   N)r   r   N)r   r   N)r   r   N)r   r   N)r   r   N)r#   
__future__r   r   r   r(   kerasr   keras_layersZkeras.legacy_tf_layersr    tensorflow.python.util.tf_exportr   r   r
   Layerr-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   	AvgPool2D	MaxPool2D
max_pool2d
avg_pool2dr   r   r   r   <module>   s   

F

   S

F

   S

J

   W

J

   W

L

   Y

L

   Z