
    ёi:                       S SK Jr  S SKJr  S SKrS SKrS SKJrJr  S SK	J
r
  S SKJr  SSKJrJrJr  SS	KJr  S
SKJr  S
SKJr  S
SKJr  SSKJr  \(       a0  S SKJr  S SKJr  S SKJrJ r J!r!J"r"J#r#J$r$J%r%J&r&J'r'J(r(J)r)J*r*  S
SK+J,r,J-r-  / r.S r/S r0 " S S\5      r1 " S S\15      r2 " S S\15      r3 " S S\15      r4 " S S\15      r5 " S  S!\15      r6 " S" S#\15      r7g)$    )annotations)TYPE_CHECKINGN)Tensor	get_flags)in_dygraph_mode)param_one_alias   )get_cudnn_versionis_compiled_with_cudais_compiled_with_rocm)convert_to_list   )
functional)_update_padding_nd)Normal   )Layer)Sequence)r   )DataLayout1DDataLayout2DDataLayout3DDataLayoutND	DTypeLikeParamAttrLike	PlaceLikeSize1Size2Size3Size4Size6)_PaddingSizeMode_PaddingTensorModec                \    U [         R                  " U5      -  nSU-  S-  n[        SU5      $ Ng       @g      ?g        )npprodr   )num_channelsfilter_sizefilter_elem_numstds       T/var/www/html/banglarbhumi/venv/lib/python3.13/site-packages/paddle/nn/layer/conv.py_get_default_param_initializerr,   =   s1    "RWW[%99O S
(C#s    c                n    [        U 5       VVs/ s H  n[        U5        H  o2PM     M     snn$ s  snnf )zReverse the order of `t` and repeat each element for `n` times.
This can be used to translate padding arg used by Conv and Pooling modules
to the ones used by `F.pad`.
)reversedrange)tnx_s       r+   _reverse_repeat_listr5   C   s,    
  {5{!E!HqAHA{555s   1c                     ^  \ rS rSr% S\S'   S\S'              S                                 S	U 4S jjjrS rSrU =r$ )
_ConvNdK   r   weightbiasc                &  >^ ^ [         TT ]  5         USLd   S5       eUT l        UT l        UT l        UT l        UT l        UT l        UT l        UT l	        1 SknUU;  a  [        SU SU S35      eUS;   a   [        U[        5      (       d  [        S5      e1 S	knUU;  a  [        S
U SU S35      eUS:H  =(       d    US:H  =(       d    US:H  nU(       a  [        U5      S-
  T l        OST l        [!        XeS5      T l        [!        XS5      T l        [!        X5S5      T l        UT l        UT l        U	T l        US:w  a  [/        UUU5      u  T l        T l        T(       a  T R
                  X+-  /T R&                  QnObX-  S:w  a  [        S5      eUS;   a7  [!        XuS5      n[5        US5      T l        [/        SUU5      u  T l        T l        UX-  /T R&                  QnU U4S jnT R9                  UT R                  T R                  U" 5       T R                  S9T l        T R9                  T R                  T R                  /ST R                  T R                  S9T l        [?        5       n[A        5       (       a  Ub  SOST l!        S[E        U5      -   S-   T l#        T RF                  S:X  a8  X:X  a3  US:w  a-  X!-  S:X  a%  ST l#        [I        5       (       a  ST l!        OST l!        [A        5       (       a  [K        S5      S   (       a  ST l!        g g g ) NFz(weight_attr should not be False in Conv.>   zerosreflectcircular	replicatezpadding_mode must be one of z, but got padding_mode=''>   r=   r>   r?   zVwhen padding_mode in ['reflect', 'replicate', 'circular'], type of padding must be int>   NCLNLCNCHWNHWCNCDHWNDHWCzdata_format must be one of z, but got data_format='rD   rF   rB   r   stridedilationkernel_sizer   z(in_channels must be divisible by groups.paddingr   c                    > T(       a  g [         R                  " TR                  5      TR                  -  n SU -  S-  n[	        SU5      $ r$   )r%   r&   _kernel_size_in_channelsr   )r)   r*   self
transposeds     r+   r,   8_ConvNd.__init__.<locals>._get_default_param_initializer   sD     ggd&7&784;L;LLO(S0C#s##r-   )shapeattrdtypedefault_initializerdeviceT)rR   rQ   is_biasrS   rU   convdconv2ddepthwise_conv2dFLAGS_conv2d_disable_cudnn)&super__init___param_attr
_bias_attr_groupsrM   _out_channels_data_format_device_dtype
ValueError
isinstanceint	TypeErrorlen_channel_dimr   _stride	_dilationrL   _padding_padding_modeoutput_paddingr   _updated_padding_padding_algorithmr5    _reversed_padding_repeated_twicecreate_parameterr9   r:   r
   r   
_use_cudnnstr_op_typer   r   )rN   in_channelsout_channelsrI   rO   dimsrG   rJ   padding_modero   rH   groupsweight_attr	bias_attrdata_formatrU   rS   valid_padding_modesvalid_formatchannel_lastfilter_shape_paired_paddingr,   cudnn_version	__class__s   `   `                   r+   r]   _ConvNd.__init__O   s   * 	%' 	
6	
' '#')'K22./B.CC[\h[iijk   
 
 Wc**h  Hl*-l^;RS^R__`a 
 F" &w&&u$ 	
  #K 01 4D !D&vX>(D+K}M),19=Ot>:D!4#: !!& ""L #q( !KLLCC"1'"K8L#Q95 'q,=)+ % ""L	$ ++!!++ > @<< , 
 ))%%&++<< * 
	 *+ &''M,E  	 T*S0==H$!q *a/.DM$&&"&"' "##67, $DO	 $r-   c                   SnU R                   S/[        U R                   5      -  :w  a  US-  nU R                  S:w  a  US-  nU R                  S:w  a  US-  nU R                  S:w  a  US-  nU R
                  S/[        U R
                  5      -  :w  a  US	-  nU R                  S:w  a  US
-  nUS-  nUR                  " S0 U R                  D6$ )Nz;{_in_channels}, {_out_channels}, kernel_size={_kernel_size}r   z, stride={_stride}r   z, padding={_padding}r<   z, padding_mode={_padding_mode}z!, output_padding={output_padding}z, dilation={_dilation}z, groups={_groups}z, data_format={_data_format} )	rk   ri   rm   rn   ro   rl   r`   format__dict__)rN   main_strs     r+   
extra_repr_ConvNd.extra_repr   s    P<<A3T\\!222,,H==A..H(88H!#;;H>>aS3t~~#66600H<<1,,H22///r-   )r_   rj   rb   rc   rl   rd   r`   rM   rL   rv   ra   rm   rq   rn   r^   rr   rk   rp   rt   r:   ro   r9   )r   r   r<   r   r   r   NNrC   NN)"rw   rg   rx   rg   rI   int | Sequence[int]rO   boolry   rg   rG   r   rJ   8_PaddingSizeMode | int | Sequence[int] | Sequence[Size2]rz   r"   ro   r   rH   r   r{   rg   r|   ParamAttrLike | Noner}   r   r~   r   rU   PlaceLike | NonerS   DTypeLike | NonereturnNone)	__name__
__module____qualname____firstlineno____annotations__r]   r   __static_attributes____classcell__r   s   @r+   r7   r7   K   s   N
L '(LM+2 (),0*.$*#'"&'W$W$ W$ )	W$
 W$ W$ $W$ JW$ )W$ EW$ &W$ W$ *W$  (!W$" "#W$$ !%W$&  'W$( 
)W$ W$r0 0r-   r7   c            	         ^  \ rS rSrSr    SSSSSSSSS.                             SU 4S jjjjr\" S	S
/5      SS j5       rSrU =r	$ )Conv1D   a#  
This interface is used to construct a callable object of the ``Conv1D`` class.
For more details, refer to code examples.
The convolution1D layer calculates the output based on the input, filter
and stride, padding, dilation, groups parameters. Input and
Output are in NCL format or NLC format, where N is batch size, C is the number of
the feature map, L is the length of the feature map.
Filter's shape is [MCK] , where M is the number of output feature map,
C is the number of input feature map, K is the size of the kernel.
If the groups is greater than 1, C will equal the number of input feature map divided by the groups.
If bias attribution and activation type are provided, bias is added to the
output of the convolution, and the corresponding activation function is
applied to the final result.

For each input :math:`X` , the equation is:

.. math::

    Out = \sigma (W \ast X + b)

Where:

* :math:`X`: Input value, a ``Tensor`` with 'NCL' format or 'NLC' format.
* :math:`W`: Filter value, a ``Tensor`` with shape [MCK] .
* :math:`\ast`: Convolution operation.
* :math:`b`: Bias value, a 1-D ``Tensor`` with shape [M].
* :math:`\sigma`: Activation function.
* :math:`Out`: Output value, the shape of :math:`Out` and :math:`X` may be different.

Example:

    - Input:

      Input shape: :math:`(N, C_{in}, L_{in})`

      Kernel shape: :math:`(C_{out}, C_{in}, K)`

    - Output:

      Output shape: :math:`(N, C_{out}, L_{out})`

    Where

    .. math::

        L_{out} = \frac{(L_{in} + 2 * padding - (dilation * (K - 1) + 1))}{stride} + 1

Parameters:
    in_channels(int): The number of channels in the input image.
    out_channels(int): The number of filter. It is as same as the output
        feature map.
    kernel_size (int|tuple|list): The filter size. If kernel_size is a tuple/list,
        it must contain one integer, (kernel_size).
    stride (int|tuple|list, optional): The stride size. If stride is a tuple/list, it must
        contain one integer, (stride_size). Default: 1.
    padding(int|str|tuple|list, optional): The size of zeros to be padded. It must be in one of the following forms.
        1. a string in ['valid', 'same'].
        2. an int, which means the feature map is zero paded by size of `padding` on both sides.
        3. a list[int] or tuple[int] whose length is 1, which means the feature map is zero paded by size of `padding[0]` on both sides.
        The default value is 0.
    dilation (int|tuple|list, optional): The dilation size. If dilation is a tuple/list, it must
        contain one integer, (dilation_size). Default: 1.
    groups (int, optional): The groups number of the conv2d Layer. According to grouped
        convolution in Alex Krizhevsky's Deep CNN paper: when group=2,
        the first half of the filters is only connected to the first half
        of the input channels, while the second half of the filters is only
        connected to the second half of the input channels. Default: 1.
    bias(bool, optional): Whether to learn and add the bias of this layer. If set
        to False, no bias will be created and :attr:`bias_attr` is ignored. Default: True.
    padding_mode(str, optional): Four modes: 'zeros', 'reflect', 'replicate', 'circular'.
        When in 'zeros' mode, this op uses zeros to pad the input tensor.
        When in 'reflect' mode, uses reflection of the input boundaries to pad the input tensor.
        When in 'replicate' mode, uses input boundaries to pad the input tensor.
        When in 'circular' mode, uses circular input to pad the input tensor.
        Default is 'zeros'.
    device(PlaceLike, optional): Device where the computation takes place. Default: None
    dtype(DTypeLike, optional): Data type of the weights and bias. Default: None.
    weight_attr (ParamAttr, optional): The parameter attribute for learnable weights(Parameter)
        of conv1d. If it is set to None or one attribute of ParamAttr, conv1d
        will create ParamAttr as param_attr. If the Initializer of the param_attr
        is not set, the parameter is initialized with :math:`Normal(0.0, std)`,
        and the :math:`std` is :math:`(\frac{2.0 }{filter\_elem\_num})^{0.5}`. Default: None.
    bias_attr (ParamAttr or bool, optional): The attribute for the bias of conv1d.
        If it is set to False, no bias will be added to the output units.
        If it is set to None or one attribute of ParamAttr, conv1d
        will create ParamAttr as bias_attr. If the Initializer of the bias_attr
        is not set, the bias is initialized zero. Default: None.

Attribute:

    **weight** (Parameter): the learnable weights of filter of this layer.

    **bias** (Parameter or None): the learnable bias of this layer.

Shape:
    - x: 3-D tensor with shape: (batch, in_channels, length) or (batch, length, in_channels).
    - weight: 3-D tensor with shape: (out_channels, in_channels, kernel_size)
    - bias: 1-D tensor with shape: (out_channels)
    - output: 3-D tensor with same shape as input x.

Examples:
    .. code-block:: python

        >>> import paddle
        >>> from paddle.nn import Conv1D

        >>> x = paddle.to_tensor([[[4, 8, 1, 9],
        ... [7, 2, 0, 9],
        ... [6, 9, 2, 6]]], dtype="float32")
        >>> w = paddle.to_tensor([[[9, 3, 4],
        ... [0, 0, 7],
        ... [2, 5, 6]],
        ... [[0, 3, 4],
        ... [2, 9, 7],
        ... [5, 6, 8]]], dtype="float32")

        >>> conv = Conv1D(3, 2, 3)
        >>> conv.weight.set_value(w)
        >>> y = conv(x)
        >>> print(y)
        Tensor(shape=[1, 2, 2], dtype=float32, place=Place(cpu), stop_gradient=False,
        [[[133., 238.],
        [160., 211.]]])
Tr<   NrA   r:   rz   rU   rS   r|   r}   r~   c               J   > USL a  Sn[         TU ]  UUUSSUUU	UUUUUU
US9  g )NFr   
rG   rJ   rz   rH   r{   r|   r}   r~   rU   rS   r\   r]   rN   rw   rx   rI   rG   rJ   rH   r{   r:   rz   rU   rS   r|   r}   r~   r   s                  r+   r]   Conv1D.__init__x  P    $ 5=I%## 	 	
r-   r3   inputc                \   SnU R                   S:w  a6  [        R                  " UU R                  U R                   U R                  S9nOU R
                  n[        R                  " UU R                  U R                  UU R                  U R                  U R                  U R                  S9nU$ )Nr   r<   moder~   )r:   rJ   rG   rH   r{   r~   )rn   Fpadrr   rb   rm   conv1dr9   r:   rk   rl   r`   )rN   r3   rJ   outs       r+   forwardConv1D.forward  s    (55'' --	A mmGhhKK<<^^<<))	
 
r-   r   r   r   r   r   )rw   rg   rx   rg   rI   r   rG   r   rJ   2_PaddingSizeMode | Size1 | Size2 | Sequence[Size2]rH   r   r{   rg   r:   r   rz   r"   rU   r   rS   r   r|   r   r}   r   r~   r   r   r   r3   r   r   r   
r   r   r   r   __doc__r]   r   r   r   r   r   s   @r+   r   r      s    {D FG$
 +2#'"&,0*.$)!$
$
 $
 	$

 $
 D$
 $
 $
 $
 )$
 !$
  $
 *$
 ($
  "!$
" 
#$
 $
L c7^$ %r-   r   c                     ^  \ rS rSrSr        S                       SU 4S jjjrSS	S jjrSrU =r$ )
Conv1DTransposei  a  
This interface is used to construct a callable object of the ``Conv1DTranspose`` class.
For more details, refer to code examples.
The 1-D convolution transpose layer calculates the output based on the input,
filter, and dilation, stride, padding. Input(Input) and output(Output)
are in 'NCL' format or 'NLC' where N is batch size, C is the number of channels,
L is the length of the feature. The details of convolution transpose
layer, please refer to the following explanation and references
`therein <https://arxiv.org/pdf/1603.07285.pdf>`_.
If bias attribution and activation type are provided, bias is added to
the output of the convolution, and the corresponding activation function
is applied to the final result.

For each input :math:`X`, the equation is:

.. math::

    Out = \sigma (W \ast X + b)

Where:

* :math:`X`: Input value, a 3-D Tensor with 'NCL' format or 'NLC' format.
* :math:`W`: Kernel value, a 3-D Tensor with 'MCK' format.
* :math:`\ast`: Convolution operation.
* :math:`b`: Bias value, a 2-D Tensor with shape [M, 1].
* :math:`\sigma`: Activation function.
* :math:`Out`: Output value, a 3-D Tensor with data format 'NCL' of 'NLC', the shape of :math:`Out` and :math:`X` may be different.

Example:

    - Input:

      Input shape: :math:`(N, C_{in}, L_{in})`

      Filter shape: :math:`(C_{in}, C_{out}, L_f)`

    - Output:

      Output shape: :math:`(N, C_{out}, L_{out})`

    Where

    .. math::

       L^\prime_{out} &= (L_{in} - 1) * stride - 2 * padding + dilation * (L_f - 1) + 1 \\
       L_{out} &\in [ L^\prime_{out}, L^\prime_{out} + stride ]

Note:
    The conv1d_transpose can be seen as the backward of the conv1d. For conv1d,
    when stride > 1, conv1d maps multiple input shape to the same output shape,
    so for conv1d_transpose, when stride > 1, input shape maps multiple output shape.
    If output_size is None, :math:`L_{out} = L^\prime_{out}`;
    else, the :math:`L_{out}` of the output size must between :math:`L^\prime_{out}`
    and :math:`L^\prime_{out} + stride`.

Args:
    in_channels(int): The number of channels in the input image.
    out_channels(int): The number of the filter. It is as same as the output
        feature map.
    kernel_size(int|tuple|list): The filter size. If kernel_size is a tuple/list,
        it must contain one integers, (kernel_size). None if
        use output size to calculate kernel_size. Default: None. kernel_size and
        output_size should not be None at the same time.
    stride(int|tuple|list, optional): The stride size. It means the stride in transposed convolution.
        If stride is a tuple/list, it must contain one integer, (stride_size).
        Default: stride = 1.
    padding(int|list|str|tuple, optional): The padding size. The padding argument effectively adds
        `dilation * (kernel - 1)` amount of zero-padding on both sides of input. If `padding` is a
        string, either 'VALID' or 'SAME' supported, which is the padding algorithm.
        If `padding` is a tuple or list, it could be in two forms:
        `[pad]` or `[pad_left, pad_right]`. Default: padding = 0.
    output_padding(int|list|tuple, optional): The count of zeros to be added to tail of each dimension.
        If it is a tuple/list, it must contain one integer. Default: 0.
    groups(int, optional): The groups number of the Conv2D transpose layer. Inspired by
        grouped convolution in Alex Krizhevsky's Deep CNN paper, in which
        when group=2, the first half of the filters is only connected to the
        first half of the input channels, while the second half of the
        filters is only connected to the second half of the input channels.
        Default: groups = 1.
    bias(bool, optional): Whether to use bias. Default: True.
    dilation(int|tuple|list, optional): The dilation size. It means the spacing between the kernel points.
        If dilation is a tuple/list, it must contain one integer, (dilation_size).
        Default: dilation = 1.
    weight_attr (ParamAttr, optional): The parameter attribute for learnable parameters/weights
        of conv1d_transpose. If it is set to None or one attribute of ParamAttr, conv1d_transpose
        will create ParamAttr as param_attr. If the Initializer of the param_attr
        is not set, the parameter is initialized with Xavier. Default: None.
    bias_attr (ParamAttr|bool, optional): The parameter attribute for the bias of conv1d_transpose.
        If it is set to False, no bias will be added to the output units.
        If it is set to None or one attribute of ParamAttr, conv1d_transpose
        will create ParamAttr as bias_attr. If the Initializer of the bias_attr
        is not set, the bias is initialized zero. Default: None.

Attribute:
    **weight** (Parameter): the learnable weights of filters of this layer.
    **bias** (Parameter or None): the learnable bias of this layer.

Shape:

    - x(Tensor): 3-D tensor with shape (batch, in_channels, length) when data_format is "NCL" or shape (batch, length, in_channels) when data_format is "NLC".
    - weight(Tensor): 3-D tensor with shape (in_channels, out_channels, kernel_length).
    - bias(Tensor): 1-D tensor with shape (out_channels).
    - output_size(int|tuple|list, optional): The output image size. If output size is a tuple/list, it must contain one integer, (feature_length). None if use kernel_size, padding, output_padding and stride to calculate output_size. If output_size and kernel_size are specified at the same time, They should follow the formula above. Default: None. output_size and kernel_size should not be None at the same time.
    - output(Tensor): 3-D tensor with same shape as input x.

Examples:
    .. code-block:: pycon

        >>> import paddle
        >>> from paddle.nn import Conv1DTranspose

        >>> # shape: (1, 2, 4)
        >>> x = paddle.to_tensor([[[4, 0, 9, 7],
        ... [8, 0, 9, 2]]], dtype="float32")
        >>> print(x.shape)
        paddle.Size([1, 2, 4])

        >>> # shape: (2, 1, 2)
        >>> w = paddle.to_tensor([[[7, 0]],
        ... [[4, 2]]], dtype="float32")
        >>> print(w.shape)
        paddle.Size([2, 1, 2])

        >>> conv = Conv1DTranspose(2, 1, 2)
        >>> conv.weight.set_value(w)
        >>> y = conv(x)
        >>> print(y)
        Tensor(shape=[1, 1, 5], dtype=float32, place=Place(cpu), stop_gradient=False,
        [[[60., 16., 99., 75., 4. ]]])
c                8   > [         TU ]  UUUSSUUUUUU	U
US9  g )NTr   rG   rJ   rH   ro   r{   r|   r}   r~   r   )rN   rw   rx   rI   rG   rJ   ro   r{   rH   r|   r}   r~   r   s               r+   r]   Conv1DTranspose.__init__<  >     	)## 	 	
r-   c                    [         R                  " UU R                  U R                  UU R                  U R
                  U R                  U R                  U R                  U R                  S9
nU$ )N)r:   output_sizero   rJ   rG   rH   r{   r~   )
r   conv1d_transposer9   r:   ro   rm   rk   rl   r`   rb   )rN   r3   r   r   s       r+   r   Conv1DTranspose.forwardZ  s[      KK#..MM<<^^<<))
 
r-   r   )r   r   r   r   r   NNrA   )rw   rg   rx   rg   rI   r   rG   r   rJ   r   ro   r   r{   rg   rH   r   r|   r   r}   r   r~   r   r   r   N)r3   r   r   zSize1 | Noner   r   	r   r   r   r   r   r]   r   r   r   r   s   @r+   r   r     s    AP FGMN,0*.$)

 
 	

 
 D
 K
 
 
 *
 (
 "
 

 
< r-   r   c            	         ^  \ rS rSrSr    SSSSSSSSS.                             SU 4S jjjjr\" S	S
/5      SS j5       rSrU =r	$ )Conv2Dij  a'  
This interface is used to construct a callable object of the ``Conv2D`` class.
For more details, refer to code examples.
The convolution2D layer calculates the output based on the input, filter
and strides, paddings, dilations, groups parameters. Input and
Output are in NCHW format, where N is batch size, C is the number of
the feature map, H is the height of the feature map, and W is the width of the feature map.
Filter's shape is [MCHW] , where M is the number of output feature map,
C is the number of input feature map, H is the height of the filter,
and W is the width of the filter. If the groups is greater than 1,
C will equal the number of input feature map divided by the groups.
Please refer to UFLDL's `convolution
<http://ufldl.stanford.edu/tutorial/supervised/FeatureExtractionUsingConvolution/>`_
for more details.
If bias attribution and activation type are provided, bias is added to the
output of the convolution, and the corresponding activation function is
applied to the final result.
For each input :math:`X`, the equation is:

..  math::

    Out = \sigma (W \ast X + b)

Where:

* :math:`X`: Input value, a ``Tensor`` with NCHW format.
* :math:`W`: Filter value, a ``Tensor`` with shape [MCHW] .
* :math:`\ast`: Convolution operation.
* :math:`b`: Bias value, a 1-D ``Tensor`` with shape [M].
* :math:`\sigma`: Activation function.
* :math:`Out`: Output value, the shape of :math:`Out` and :math:`X` may be different.

Parameters:
    in_channels(int): The number of input channels in the input image.
    out_channels(int): The number of output channels produced by the convolution.
    kernel_size(int|list|tuple): The size of the convolving kernel.
    stride(int|list|tuple, optional): The stride size. If stride is a list/tuple, it must
        contain two integers, (stride_H, stride_W). Otherwise, the
        stride_H = stride_W = stride. The default value is 1.
    padding(int|str|tuple|list, optional): The padding size. Padding could be in one of the following forms.
        1. a string in ['valid', 'same'].
        2. an int, which means each spatial dimension(depth, height, width) is zero paded by size of `padding`
        3. a list[int] or tuple[int] whose length is the number of spatial dimensions, which contains the amount of padding on each side for each spatial dimension. It has the form [pad_d1, pad_d2, ...].
        4. a list[int] or tuple[int] whose length is 2 * number of spatial dimensions. It has the form  [pad_before, pad_after, pad_before, pad_after, ...] for all spatial dimensions.
        5. a list or tuple of pairs of ints. It has the form [[pad_before, pad_after], [pad_before, pad_after], ...]. Note that, the batch dimension and channel dimension are also included. Each pair of integers correspond to the amount of padding for a dimension of the input. Padding in batch dimension and channel dimension should be [0, 0] or (0, 0).
        The default value is 0.
    dilation(int|list|tuple, optional): The dilation size. If dilation is a list/tuple, it must
        contain two integers, (dilation_H, dilation_W). Otherwise, the
        dilation_H = dilation_W = dilation. The default value is 1.
    groups(int, optional): The groups number of the Conv2D Layer. According to grouped
        convolution in Alex Krizhevsky's Deep CNN paper: when group=2,
        the first half of the filters is only connected to the first half
        of the input channels, while the second half of the filters is only
        connected to the second half of the input channels. The default value is 1.
    bias(bool, optional): Whether to learn and add the bias of this layer. If set
        to False, no bias will be created and :attr:`bias_attr` is ignored. Default: True.
    padding_mode(str, optional): ``'zeros'``, ``'reflect'``, ``'replicate'`` or ``'circular'``. Default: ``'zeros'``.
    device(PlaceLike, optional): Device where the computation takes place. Default: None
    dtype(DTypeLike, optional): Data type of the weights and bias. Default: None.
    weight_attr(ParamAttr, optional): The parameter attribute for learnable parameters/weights
        of conv2d. If it is set to None or one attribute of ParamAttr, conv2d
        will create ParamAttr as param_attr. If it is set to None, the parameter
        is initialized with :math:`Normal(0.0, std)`, and the :math:`std` is
        :math:`(\frac{2.0 }{filter\_elem\_num})^{0.5}`. The default value is None.
    bias_attr(ParamAttr|bool, optional): The parameter attribute for the bias of conv2d.
        If it is set to False, no bias will be added to the output units.
        If it is set to None or one attribute of ParamAttr, conv2d
        will create ParamAttr as bias_attr. If the Initializer of the bias_attr
        is not set, the bias is initialized zero. The default value is None.
    data_format(str, optional): Data format that specifies the layout of input.
        It can be "NCHW" or "NHWC". Default: "NCHW".
Attribute:

    **weight** (Parameter): the learnable weights of filter of this layer.

    **bias** (Parameter or None): the learnable bias of this layer.

Shape:

    - x: :math:`(N, C_{in}, H_{in}, W_{in})`

    - weight: :math:`(C_{out}, C_{in}, K_{h}, K_{w})`

    - bias: :math:`(C_{out})`

    - output: :math:`(N, C_{out}, H_{out}, W_{out})`

    Where

    ..  math::

       H_{out}&= \frac{(H_{in} + 2 * paddings[0] - (dilations[0] * (kernel\_size[0] - 1) + 1))}{strides[0]} + 1

       W_{out}&= \frac{(W_{in} + 2 * paddings[1] - (dilations[1] * (kernel\_size[1] - 1) + 1))}{strides[1]} + 1

Examples:

    .. code-block:: pycon

        >>> import paddle
        >>> import paddle.nn as nn

        >>> paddle.disable_static()

        >>> x_var = paddle.uniform((2, 4, 8, 8), dtype='float32', min=-1.0, max=1.0)

        >>> conv = nn.Conv2D(4, 6, (3, 3))
        >>> y_var = conv(x_var)
        >>> print(y_var.shape)
        paddle.Size([2, 6, 6, 6])
Tr<   NrC   r   c               J   > USL a  Sn[         TU ]  UUUSSUUU	UUUUUU
US9  g )NFr   r   r   r   s                  r+   r]   Conv2D.__init__  r   r-   r3   r   c                   U R                   S:w  a5  [        R                  " UU R                  U R                   U R                  S9n[        5       (       Ga!  UR                  5       (       Ga  U R                  S;   a  U R                  S:X  a  SnOU R                  S:X  a  SnUR                   H  nU[        R                  R                  W5      :X  d  M(  [        R                  R                  R                  R                  R                  UU R                  U R                   U R"                  U R$                  U R&                  U R(                  U R*                  U R                  U R,                  S9
s  $    [        R.                  R1                  UU R                  U R                   U R"                  U R$                  U R&                  U R(                  U R*                  U R                  U R,                  U R2                  U R4                  S	9nU$ )
Nr<   r   )rC   rD   rC   r	   rD   r   )r:   rG   rJ   padding_algorithmrH   r{   r~   channel_dim
r:   rG   rJ   r   rH   r{   r~   r   op_type	use_cudnn)rn   r   r   rr   rb   r   is_dist
placementspaddledistributedShardauto_parallel	ring_conv
RingConv2dapplyr9   r:   rk   rp   rq   rl   r`   rj   rW   _conv_ndrv   rt   )rN   r3   
shard_axis	placementr   s        r+   r   Conv2D.forward  s   (55'' --	A 		!!%55  F*
""f,
\\	 2 2 8 8 DD!--;;EEPPVV!YY#|| $ 5 5*.*A*A!%#||$($5$5$($5$5 W   * ffooKK<<))"55^^<<))))MMoo  
 
r-   r   r   )rw   rg   rx   rg   rI   r   rG   r   rJ   2_PaddingSizeMode | Size2 | Size4 | Sequence[Size2]rH   r   r{   rg   r:   r   rz   r"   rU   r   rS   r   r|   r   r}   r   r~   r   r   r   r   r   r   s   @r+   r   r   j  s    nj FG$
 +2#'"&,0*.$*!$
$
 $
 	$

 $
 D$
 $
 $
 $
 )$
 !$
  $
 *$
 ($
  "!$
" 
#$
 $
L c7^$2 %2r-   r   c                     ^  \ rS rSrSr        S                       SU 4S jjjrSS	S jjrSrU =r$ )
Conv2DTransposei7  aS  
This interface is used to construct a callable object of the ``Conv2DTranspose`` class.
For more details, refer to code examples.
The convolution2D transpose layer calculates the output based on the input,
filter, and dilations, strides, paddings. Input and output
are in NCHW format. Where N is batch size, C is the number of feature map,
H is the height of the feature map, and W is the width of the feature map.
Filter's shape is [CMHW] , where C is the number of input feature map,
M is the number of output feature map, H is the height of the filter,
and W is the width of the filter. If the groups is greater than 1,
C will equal the number of input feature map divided by the groups.
If bias attribution and activation type are provided, bias is added to
the output of the convolution, and the corresponding activation function
is applied to the final result.
The details of convolution transpose layer, please refer to the following explanation and references
`conv2dtranspose <https://arxiv.org/pdf/1603.07285.pdf>`_ .
For each input :math:`X`, the equation is:

..  math::

    Out = \sigma (W \ast X + b)

Where:

* :math:`X`: Input value, a ``Tensor`` with NCHW format.
* :math:`W`: Filter value, a ``Tensor`` with shape [CMHW] .
* :math:`\ast`: Convolution operation.
* :math:`b`: Bias value, a 1-D ``Tensor`` with shape [M].
* :math:`\sigma`: Activation function.
* :math:`Out`: Output value, a 4-D ``Tensor`` with NCHW or NHWC format, the shape of :math:`Out` and :math:`X` may be different.

Note:
    If output_size is None, :math:`H_{out}` = :math:`H^\prime_{out}` , :math:`W_{out}` = :math:`W^\prime_{out}`. Otherwise, the specified output_size_height (the height of the output feature layer) :math:`H_{out}` should be between :math:`H^\prime_{out}` and :math:`H^\prime_{out} + strides[0]` (excluding :math:`H^\prime_{out} + strides[0]` ).

Parameters:
    in_channels(int): The number of channels in the input image.
    out_channels(int): The number of channels produced by the convolution.
    kernel_size(int|list|tuple): The kernel size. If kernel_size is a list/tuple,
        it must contain two integers, (kernel_size_H, kernel_size_W).
        Otherwise, the kernel will be a square.
    stride(int|list|tuple, optional): The stride size. If stride is a list/tuple, it must
        contain two integers, (stride_H, stride_W). Otherwise, the
        stride_H = stride_W = stride. Default: 1.
    padding(int|str|tuple|list, optional): The padding size. Padding could be in one of the following forms.
        1. a string in ['valid', 'same'].
        2. an int, which means each spatial dimension(depth, height, width) is zero paded by size of `padding` on both sides
        3. a list[int] or tuple[int] whose length is the number of spatial dimensions, which contains the amount of padding on each side for each spatial dimension. It has the form [pad_d1, pad_d2, ...].
        4. a list[int] or tuple[int] whose length is 2 * number of spatial dimensions. It has the form  [pad_before, pad_after, pad_before, pad_after, ...] for all spatial dimensions.
        5. a list or tuple of pairs of ints. It has the form [[pad_before, pad_after], [pad_before, pad_after], ...]. Note that, the batch dimension and channel dimension are also included. Each pair of integers correspond to the amount of padding for a dimension of the input. Padding in batch dimension and channel dimension should be [0, 0] or (0, 0).
        The default value is 0.
    output_padding(int|list|tuple, optional): Additional size added to one side
        of each dimension in the output shape. Default: 0.
    dilation(int|list|tuple, optional): The dilation size. If dilation is a list/tuple, it must
        contain two integers, (dilation_H, dilation_W). Otherwise, the
        dilation_H = dilation_W = dilation. Default: 1.
    groups(int, optional): The groups number of the Conv2D transpose layer. Inspired by
        grouped convolution in Alex Krizhevsky's Deep CNN paper, in which
        when group=2, the first half of the filters is only connected to the
        first half of the input channels, while the second half of the
        filters is only connected to the second half of the input channels.
        Default: 1.
    weight_attr(ParamAttr, optional): The parameter attribute for learnable weights(Parameter)
        of conv2d_transpose. If it is set to None or one attribute of ParamAttr, conv2d_transpose
        will create ParamAttr as param_attr. If the Initializer of the param_attr
        is not set, the parameter is initialized with Xavier. Default: None.
    bias_attr(ParamAttr|bool, optional): The attribute for the bias of conv2d_transpose.
        If it is set to False, no bias will be added to the output units.
        If it is set to None or one attribute of ParamAttr, conv2d_transpose
        will create ParamAttr as bias_attr. If the Initializer of the bias_attr
        is not set, the bias is initialized zero. Default: None.
    data_format(str, optional): Data format that specifies the layout of input.
        It can be "NCHW" or "NHWC". Default: "NCHW".

Attribute:

    **weight** (Parameter): the learnable weights of filters of this layer.

    **bias** (Parameter or None): the learnable bias of this layer.

Shape:

    - x: :math:`(N, C_{in}, H_{in}, W_{in})`

    - weight: :math:`(C_{in}, C_{out}, K_{h}, K_{w})`

    - bias: :math:`(C_{out})`

    - output: :math:`(N, C_{out}, H_{out}, W_{out})`

    Where

    ..  math::

       H^\prime_{out} &= (H_{in} - 1) * strides[0] - 2 * paddings[0] + dilations[0] * (kernel\_size[0] - 1) + 1

       W^\prime_{out} &= (W_{in} - 1) * strides[1] - 2 * paddings[1] + dilations[1] * (kernel\_size[1] - 1) + 1

       H_{out} &\in [ H^\prime_{out}, H^\prime_{out} + strides[0] )

       W_{out} &\in [ W^\prime_{out}, W^\prime_{out} + strides[1] )

Examples:

    .. code-block:: pycon

        >>> import paddle
        >>> import paddle.nn as nn

        >>> paddle.disable_static()

        >>> x_var = paddle.uniform((2, 4, 8, 8), dtype='float32', min=-1.0, max=1.0)

        >>> conv = nn.Conv2DTranspose(4, 6, (3, 3))
        >>> y_var = conv(x_var)
        >>> print(y_var.shape)
        paddle.Size([2, 6, 10, 10])
c                8   > [         TU ]  UUUSSUUUUUU	U
US9  g )NTr   r   r   rN   rw   rx   rI   rG   rJ   ro   rH   r{   r|   r}   r~   r   s               r+   r]   Conv2DTranspose.__init__  r   r-   c                    Uc  U R                   nOSn[        R                  " UU R                  U R                  U R
                  UU R                  U R                  U R                  UU R                  S9
nU$ Nr   )r:   rJ   ro   rG   rH   r{   r   r~   )
ro   r   conv2d_transposer9   r:   rm   rk   rl   r`   rb   rN   r3   r   ro   r   s        r+   r   Conv2DTranspose.forward  k    !00NN  KKMM)<<^^<<#))
 
r-   r   )r   r   r   r   r   NNrC   )rw   rg   rx   rg   rI   r   rG   r   rJ   r   ro   r   rH   r   r{   rg   r|   r   r}   r   r~   r   r   r   r   )r3   r   r   zSize2 | Noner   r   r   r   s   @r+   r   r   7  s    tv FGMN,0*.$*

 
 	

 
 D
 K
 
 
 *
 (
 "
 

 
< r-   r   c            	         ^  \ rS rSrSr    SSSSSSSSS.                             SU 4S jjjjr\" S	S
/5      SS j5       rSrU =r	$ )Conv3Di  a  
**Convlution3d Layer**
The convolution3d layer calculates the output based on the input, filter
and strides, paddings, dilations, groups parameters. Input(Input) and
Output(Output) are multidimensional tensors with a shape of
:math:`[N, C, D, H, W]` . Where N is batch size, C is the number of
channels, D is the depth of the feature, H is the height of the feature,
and W is the width of the feature. Convlution3D is similar with Convlution2D
but adds one dimension(depth). If bias attribution and activation type are
provided, bias is added to the output of the convolution, and the
corresponding activation function is applied to the final result.
For each input :math:`X`, the equation is:

..  math::

    Out = \sigma (W \ast X + b)

In the above equation:

* :math:`X`: Input value, a tensor with NCDHW or NDHWC format.
* :math:`W`: Filter value, a tensor with MCDHW format.
* :math:`\ast`: Convolution operation.
* :math:`b`: Bias value, a 1-D tensor with shape [M].
* :math:`\sigma`: Activation function.
* :math:`Out`: Output value, the shape of :math:`Out` and :math:`X` may be different.

Parameters:
    in_channels(int): The number of input channels in the input image.
    out_channels(int): The number of output channels produced by the convolution.
    kernel_size(int|list|tuple): The size of the convolving kernel.
    stride(int|list|tuple, optional): The stride size. If stride is a list/tuple, it must
        contain three integers, (stride_D, stride_H, stride_W). Otherwise, the
        stride_D = stride_H = stride_W = stride. The default value is 1.
    padding(int|str|tuple|list, optional): The padding size. Padding could be in one of the following forms.
        1. a string in ['valid', 'same'].
        2. an int, which means each spatial dimension(depth, height, width) is zero paded by size of `padding`
        3. a list[int] or tuple[int] whose length is the number of spatial dimensions, which contains the amount of padding on each side for each spatial dimension. It has the form [pad_d1, pad_d2, ...].
        4. a list[int] or tuple[int] whose length is 2 * number of spatial dimensions. It has the form  [pad_before, pad_after, pad_before, pad_after, ...] for all spatial dimensions.
        5. a list or tuple of pairs of ints. It has the form [[pad_before, pad_after], [pad_before, pad_after], ...]. Note that, the batch dimension and channel dimension are also included. Each pair of integers correspond to the amount of padding for a dimension of the input. Padding in batch dimension and channel dimension should be [0, 0] or (0, 0).
        The default value is 0.
    dilation(int|list|tuple, optional): The dilation size. If dilation is a list/tuple, it must
        contain three integers, (dilation_D, dilation_H, dilation_W). Otherwise, the
        dilation_D = dilation_H = dilation_W = dilation. The default value is 1.
    groups(int, optional): The groups number of the Conv3D Layer. According to grouped
        convolution in Alex Krizhevsky's Deep CNN paper: when group=2,
        the first half of the filters is only connected to the first half
        of the input channels, while the second half of the filters is only
        connected to the second half of the input channels. The default value is 1.
    bias(bool, optional): Whether to learn and add the bias of this layer. If set
        to False, no bias will be created and :attr:`bias_attr` is ignored. Default: True.
    padding_mode(str, optional): ``'zeros'``, ``'reflect'``, ``'replicate'`` or ``'circular'``. Default: ``'zeros'``.
    device(PlaceLike, optional): Device where the computation takes place. Default: None
    dtype(DTypeLike, optional): Data type of the weights and bias. Default: None.
    weight_attr(ParamAttr, optional): The parameter attribute for learnable parameters/weights
        of conv3d. If it is set to None or one attribute of ParamAttr, conv3d
        will create ParamAttr as param_attr. If it is set to None, the parameter
        is initialized with :math:`Normal(0.0, std)`, and the :math:`std` is
        :math:`(\frac{2.0 }{filter\_elem\_num})^{0.5}`. The default value is None.
    bias_attr(ParamAttr|bool, optional): The parameter attribute for the bias of conv3d.
        If it is set to False, no bias will be added to the output units.
        If it is set to None or one attribute of ParamAttr, conv3d
        will create ParamAttr as bias_attr. If the Initializer of the bias_attr
        is not set, the bias is initialized zero. The default value is None.
    data_format(str, optional): Data format that specifies the layout of input.
        It can be "NCDHW" or "NDHWC". Default: "NCDHW".

Attribute:

    **weight** (Parameter): the learnable weights of filters of this layer.

    **bias** (Parameter): the learnable bias of this layer.

Shape:

    - x: :math:`(N, C_{in}, D_{in}, H_{in}, W_{in})`

    - weight: :math:`(C_{out}, C_{in}, K_{d}, K_{h}, K_{w})`

    - bias: :math:`(C_{out})`

    - output: :math:`(N, C_{out}, D_{out}, H_{out}, W_{out})`

    Where

    ..  math::

       D_{out}&= \frac{(D_{in} + 2 * paddings[0] - (dilations[0] * (kernel\_size[0] - 1) + 1))}{strides[0]} + 1

       H_{out}&= \frac{(H_{in} + 2 * paddings[1] - (dilations[1] * (kernel\_size[1] - 1) + 1))}{strides[1]} + 1

       W_{out}&= \frac{(W_{in} + 2 * paddings[2] - (dilations[2] * (kernel\_size[2] - 1) + 1))}{strides[2]} + 1

Examples:

    .. code-block:: pycon

        >>> import paddle
        >>> import paddle.nn as nn

        >>> paddle.disable_static()

        >>> x_var = paddle.uniform((2, 4, 8, 8, 8), dtype='float32', min=-1.0, max=1.0)

        >>> conv = nn.Conv3D(4, 6, (3, 3, 3))
        >>> y_var = conv(x_var)
        >>> print(y_var.shape)
        paddle.Size([2, 6, 6, 6, 6])
Tr<   NrE   r   c               J   > USL a  Sn[         TU ]  UUUSSUUU	UUUUUU
US9  g )NFr	   r   r   r   s                  r+   r]   Conv3D.__init__O  sP    $ 5=I%## 	 	
r-   r3   r   c                   U R                   S:w  a5  [        R                  " UU R                  U R                   U R                  S9n[        R
                  R                  UU R                  U R                  U R                  U R                  U R                  U R                  U R                  U R                  U R                  U R                  U R                   S9nU$ )Nr<   r   r   )rn   r   r   rr   rb   rW   r   r9   r:   rk   rp   rq   rl   r`   rj   rv   rt   )rN   r3   r   s      r+   r   Conv3D.forwardv  s    (55'' --	A ffooKK<<))"55^^<<))))MMoo  
 
r-   r   r   )rw   rg   rx   rg   rI   r   rG   r   rJ   2_PaddingSizeMode | Size3 | Size6 | Sequence[Size2]rH   r   r{   rg   r:   r   rz   r"   rU   r   rS   r   r|   r   r}   r   r~   r   r   r   r   r   r   s   @r+   r   r     s    kd FG%
 +2#'"&,0*.$+!%
%
 %
 	%

 %
 D%
 %
 %
 %
 )%
 !%
  %
 *%
 (%
  "!%
" 
#%
 %
N c7^$ %r-   r   c                     ^  \ rS rSrSr        S                       SU 4S jjjrSS	S jjrSrU =r$ )
Conv3DTransposei  a  
**Convlution3D transpose layer**
The convolution3D transpose layer calculates the output based on the input,
filter, and dilations, strides, paddings. Input(Input) and output(Output)
are in NCDHW format. Where N is batch size, C is the number of channels,
D is the depth of the feature, H is the height of the feature, and W
is the width of the feature. Parameters(dilations, strides, paddings) are
two elements. These two elements represent height and width, respectively.
The details of convolution transpose layer, please refer to the following
explanation and references `therein <https://arxiv.org/pdf/1603.07285.pdf>`_.
If bias attribution and activation type are provided, bias is added to
the output of the convolution, and the corresponding activation function
is applied to the final result.
For each input :math:`X`, the equation is:

..  math::

    Out = \sigma (W \ast X + b)

In the above equation:

* :math:`X`: Input value, a tensor with NCDHW format.
* :math:`W`: Filter value, a tensor with CMDHW format.
* :math:`\ast`: Convolution operation.
* :math:`b`: Bias value, a 1-D tensor with shape [M].
* :math:`\sigma`: Activation function.
* :math:`Out`: Output value, the shape of :math:`Out` and :math:`X` may be different.

.. note::
    The conv3d_transpose can be seen as the backward of the conv3d. For conv3d,
    when stride > 1, conv3d maps multiple input shape to the same output shape,
    so for conv3d_transpose, when stride > 1, input shape maps multiple output shape.
    If output_size is None, :math:`H_{out} = H^\prime_{out}, W_{out} = W^\prime_{out}`;
    else, the :math:`D_{out}` of the output size must between :math:`D^\prime_{out}`
    and :math:`D^\prime_{out} + strides[0]`, the :math:`H_{out}` of the output size must
    between :math:`H^\prime_{out}` and :math:`H^\prime_{out} + strides[1]`, and the
    :math:`W_{out}` of the output size must between :math:`W^\prime_{out}` and
    :math:`W^\prime_{out} + strides[2]`, conv3d_transpose can compute the kernel size automatically.

Parameters:
    in_channels(int): The number of channels in the input image.
    out_channels(int): The number of channels produced by the convolution.
    kernel_size(int|list|tuple): The kernel size. If kernel_size is a list/tuple,
        it must contain three integers, (kernel_size_D, kernel_size_H, kernel_size_W).
        Otherwise, the kernel will be a square.
    stride(int|list|tuple, optional): The stride size. It means the stride in transposed convolution.
        If stride is a list/tuple, it must contain three integers, (stride_depth, stride_height,
        stride_width). Otherwise, stride_depth = stride_height = stride_width = stride.
        Default: 1.
    padding(int|str|tuple|list, optional): The padding size. Padding could be in one of the following forms.
        1. a string in ['valid', 'same'].
        2. an int, which means each spatial dimension(depth, height, width) is zero paded by size of `padding`
        3. a list[int] or tuple[int] whose length is the number of spatial dimensions, which contains the amount of padding on each side for each spatial dimension. It has the form [pad_d1, pad_d2, ...].
        4. a list[int] or tuple[int] whose length is 2 * number of spatial dimensions. It has the form  [pad_before, pad_after, pad_before, pad_after, ...] for all spatial dimensions.
        5. a list or tuple of pairs of ints. It has the form [[pad_before, pad_after], [pad_before, pad_after], ...]. Note that, the batch dimension and channel dimension are also included. Each pair of integers correspond to the amount of padding for a dimension of the input. Padding in batch dimension and channel dimension should be [0, 0] or (0, 0).
        Default: 0.
    output_padding(int|list|tuple, optional): Additional size added to one side
        of each dimension in the output shape. Default: 0.
    dilation(int|list|tuple, optional): The dilation size. If dilation is a list/tuple, it must
        contain three integers, (dilation_D, dilation_H, dilation_W). Otherwise, the
        dilation_D = dilation_H = dilation_W = dilation. Default: 1.
    groups(int, optional): The groups number of the Conv3D transpose layer. Inspired by
        grouped convolution in `Alex Krizhevsky's Deep CNN paper <https://papers.nips.cc/paper/2012/file/c399862d3b9d6b76c8436e924a68c45b-Paper.pdf>`_, in which
        when groups = 2, the first half of the filters is only connected to the
        first half of the input channels, while the second half of the
        filters is only connected to the second half of the input channels.
        Default: 1.
    weight_attr(ParamAttr, optional): The parameter attribute for learnable parameters/weights
        of conv3d_transpose. If it is set to None or one attribute of ParamAttr, conv3d_transpose
        will create ParamAttr as param_attr. If the Initializer of the param_attr
        is not set, the parameter is initialized with Xavier. Default: None.
    bias_attr(ParamAttr|bool, optional): The parameter attribute for the bias of conv3d_transpose.
        If it is set to False, no bias will be added to the output units.
        If it is set to None or one attribute of ParamAttr, conv3d_transpose
        will create ParamAttr as bias_attr. If the Initializer of the bias_attr
        is not set, the bias is initialized zero. Default: None.
    data_format(str, optional): Data format that specifies the layout of input.
        It can be "NCDHW" or "NDHWC". Default: "NCDHW".

Attribute:

    **weight** (Parameter): the learnable weights of filters of this layer.

    **bias** (Parameter): the learnable bias of this layer.

Shape:

    - x: :math:`(N, C_{in}, D_{in}, H_{in}, W_{in})`

    - weight: :math:`(C_{in}, C_{out}, K_{d}, K_{h}, K_{w})`

    - bias: :math:`(C_{out})`

    - output: :math:`(N, C_{out}, D_{out}, H_{out}, W_{out})`

    Where

    ..  math::

       D^\prime_{out} &= (D_{in} - 1) * strides[0] - 2 * paddings[0] + dilations[0] * (kernel\_size[0] - 1) + 1

       H^\prime_{out} &= (H_{in} - 1) * strides[1] - 2 * paddings[1] + dilations[1] * (kernel\_size[1] - 1) + 1

       W^\prime_{out} &= (W_{in} - 1) * strides[2] - 2 * paddings[2] + dilations[2] * (kernel\_size[2] - 1) + 1

Examples:

    .. code-block:: pycon

        >>> import paddle
        >>> import paddle.nn as nn

        >>> paddle.disable_static()

        >>> x_var = paddle.uniform((2, 4, 8, 8, 8), dtype='float32', min=-1.0, max=1.0)

        >>> conv = nn.Conv3DTranspose(4, 6, (3, 3, 3))
        >>> y_var = conv(x_var)
        >>> print(y_var.shape)
        paddle.Size([2, 6, 10, 10, 10])
c                8   > [         TU ]  UUUSSUUUUUU	U
US9  g )NTr	   r   r   r   s               r+   r]   Conv3DTranspose.__init__  r   r-   c                    Uc  U R                   nOSn[        R                  " UU R                  U R                  U R
                  UU R                  U R                  U R                  UU R                  S9
nU$ r   )
ro   r   conv3d_transposer9   r:   rm   rk   rl   r`   rb   r   s        r+   r   Conv3DTranspose.forward*  r   r-   r   )r   r   r   r   r   NNrE   )rw   rg   rx   rg   rI   r   rG   r   rJ   r   ro   r   rH   r   r{   rg   r|   r   r}   r   r~   r   r   r   r   )r3   r   r   zSize3 | Noner   r   r   r   s   @r+   r   r     s    x~ FGMN,0*.$+

 
 	

 
 D
 K
 
 
 *
 (
 "
 

 
< r-   r   )8
__future__r   typingr   numpyr%   r   r   r   paddle.base.frameworkr   paddle.utils.decorator_utilsr   rU   r
   r   r   utilsr    r   r   functional.convr   initializerr   layersr   collections.abcr   paddle._typingr   r   r   r   r   r   r   r   r   r   r   r    functional.commonr!   r"   __all__r,   r5   r7   r   r   r   r   r   r   r   r-   r+   <module>r     s    #     $ 1 8 
 %  0   (    I
6l0e l0^{W {|og odJW JZgg gTmW m`kg kr-   