
    ёi                        S SK Jr  S SKJrJr  S SKJr  S SKJr  S SK	J
r
  S SKJr  \(       a  S SKJr  S SKJrJr  S S	KJr  / r     S               SS jjrg
)    )annotations)TYPE_CHECKINGLiteral)_C_ops)in_dynamic_or_pir_mode)_update_padding_nd)convert_to_list)Tensor)Size3Size6)_PaddingSizeModeNc                   [        5       (       d   S5       eU R                  5       (       d   S5       eUS:X  d   S5       e[        USS5      nUc  UnO[        USS5      nSn[        USXtS	9u  p8/ S
Qn	[        R
                  " XX9U5      $ )a  
Implements sparse max pooling 3d operation.
See more details in :ref:`api_paddle_sparse_nn_MaxPool3D` .

Args:
    x (Tensor): The input SparseCooTensor of pooling operator, which is a 5-D tensor with
                      shape [N, D, H, W, C]. The format of input tensor `"NDHWC"`, where N represents batch size, C represents the number of channels, D, H and W represent the depth, height and width of the feature respectively.
    kernel_size (int|list|tuple): The pool kernel size. If the kernel size
        is a tuple or list, it must contain three integers,
        (kernel_size_Depth, kernel_size_Height, kernel_size_Width).
        Otherwise, the pool kernel size will be the cube of an int.
    stride (int|list|tuple, optional): The pool stride size. If pool stride size is a tuple or list,
        it must contain three integers, [stride_Depth, stride_Height, stride_Width).
        Otherwise, the pool stride size will be a cube of an int.
    padding (string|int|list|tuple, optional): The padding size. Padding could be in one of the following forms.
        1. A string in ['valid', 'same'].
        2. An int, which means the feature map is zero padded by size of `padding` on every sides.
        3. A list[int] or tuple(int) whose length is 3, [pad_depth, pad_height, pad_weight] whose value means the padding size of each dimension.
        4. A list[int] or tuple(int) whose length is 6. [pad_depth_front, pad_depth_back, pad_height_top, pad_height_bottom, pad_width_left, pad_width_right] whose value means the padding size of each side.
        5. A list or tuple of pairs of integers. It has the form [[pad_before, pad_after], [pad_before, pad_after], ...]. Note that, the batch dimension and channel dimension should be [0,0] or (0,0).
        The default value is 0.
    ceil_mode (bool, optional): ${ceil_mode_comment}
    data_format (string, optional): The data format of the input and output data. An optional string from: `"NCDHW"`, `"NDHWC"`.
                    The default is `"NCDHW"`. When it is `"NCDHW"`, the data is stored in the order of:
                    `[batch_size, input_channels, input_depth, input_height, input_width]`. Currently only support `"NDHWC"` .
    name(str|None, optional): For detailed information, please refer
                         to :ref:`api_guide_Name`. Usually name is no need to set and
                         None by default.

Returns:
    Tensor: The output tensor of pooling result. The data type is same as input tensor.

Examples:
    .. code-block:: pycon

        >>> import paddle

        >>> dense_x = paddle.randn((1, 4, 4, 4, 3))
        >>> sparse_x = dense_x.to_sparse_coo(4)
        >>> kernel_sizes = [3, 3, 3]
        >>> paddings = [0, 0, 0]
        >>> strides = [1, 1, 1]
        >>> out = paddle.sparse.nn.functional.max_pool3d(sparse_x, kernel_sizes, stride=strides, padding=paddings)
        >>> print(out.shape)
        paddle.Size([1, 2, 2, 2, 3])
z<Currently, Sparse API only support dynamic mode or pir mode.z@Currently, sparse.relu only support the input of SparseCooTensorNDHWCz@Currently, sparse.max_pool3d only support data format of 'NDHWC'   	pool_sizepool_strideT)channel_last	ceil_mode)   r   r   )r   is_sparse_coor	   r   r   sparse_maxpool)
xkernel_sizestridepaddingr   data_formatnamer   padding_algorithmdilations
             c/var/www/html/banglarbhumi/venv/lib/python3.13/site-packages/paddle/sparse/nn/functional/pooling.py
max_pool3dr!   $   s    p "## F# ?? J '! J! "+q+>K~ M:L!3"G
 H  FKK    )Nr   Fr   N)r   r
   r   r   r   zSize3 | Noner   z _PaddingSizeMode | Size3 | Size6r   boolr   zLiteral['NDHWC']r   z
str | Nonereturnr
   )
__future__r   typingr   r   paddler   paddle.frameworkr   paddle.nn.functional.poolingr   paddle.utilsr	   r
   paddle._typingr   r   paddle.nn.functional.commonr   __all__r!    r"   r    <module>r/      s     # )  3 ; ( =
  01$+QLQLQL QL .	QL
 QL "QL QL QLr"   