parameters: (x,
                       weight,
                       bias=None,
                       stride=1,
                       padding=0,
                       output_padding=0,
                       groups=1,
                       dilation=1,
                       output_size=None,
                       data_format='NCDHW',
                       name=None)
return_statement: return out
docstring: r"""
      The convolution3d transpose layer calculates the output based on the input,
      filter, and dilations, strides, paddings. Input(Input) and output(Output)
      are in NCDHW or NDHWC 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.
      See more detail in :ref:`api_nn_conv_ConvTranspose3d` .
  
      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 2-D Tensor with shape [M, 1].
      * :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}, D_{in}, H_{in}, W_{in})`
  
            Filter shape: :math:`(C_{in}, C_{out}, D_f, H_f, W_f)`
  
          - Output:
  
            Output shape: :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] * (D_f - 1) + 1 \\\\
             H^\prime_{out} &= (H_{in} - 1) * strides[1] - 2 * paddings[1] + dilations[1] * (H_f - 1) + 1 \\\\
             W^\prime_{out} &= (W_{in} - 1) * strides[2] - 2 * paddings[2] + dilations[2] * (W_f - 1) + 1 \\\\
             D_{out} &\in [ D^\prime_{out}, D^\prime_{out} + strides[0] ] \\\\
             H_{out} &\in [ H^\prime_{out}, H^\prime_{out} + strides[1] ] \\\\
             W_{out} &\in [ W^\prime_{out}, W^\prime_{out} + strides[2] ]
  
      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}, :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]`.
  
      Args:
          x(Tensor): The input is 5-D Tensor with shape [N, C, D, H, W] or [N, D, H, W, C], the data type 
              of input is float32 or float64.
          weight (Tensor): The convolution kernel, a Tensor with shape [C, M/g, kD, kH, kW],
              where M is the number of filters(output channels), g is the number of groups,
              kD, kH, kW are the filter's depth, height and width respectively.
          bias (Tensor, optional): The bias, a Tensor of shape [M, ].
          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: stride = 1.
          padding (string|int|list|tuple, optional): The padding size. It means the number of zero-paddings 
              on both sides for each dimension. If `padding` is a string, either 'VALID' or
              'SAME' which is the padding algorithm. If padding size is a tuple or list,
              it could be in three forms: `[pad_depth, pad_height, pad_width]` or
              `[pad_depth_front, pad_depth_back, pad_height_top, pad_height_bottom, pad_width_left, pad_width_right]`,
              and when `data_format` is `"NCDHW"`, `padding` can be in the form
              `[[0,0], [0,0], [pad_depth_front, pad_depth_back], [pad_height_top, pad_height_bottom], [pad_width_left, pad_width_right]]`.
              when `data_format` is `"NDHWC"`, `padding` can be in the form
              `[[0,0], [pad_depth_front, pad_depth_back], [pad_height_top, pad_height_bottom], [pad_width_left, pad_width_right], [0,0]]`.
              Default: padding = 0.
          output_padding(int|list|tuple, optional): Additional size added to one side
              of each dimension in the output shape. Default: 0.
          groups(int, optional): The groups number of the Conv3D 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
          dilation(int|list|tuple, optional): The dilation size. It means the spacing between the kernel points. 
              If dilation is a list/tuple, it must contain three integers, (dilation_depth, dilation_height, 
              dilation_width). Otherwise, dilation_depth = dilation_height = dilation_width = dilation. 
              Default: dilation = 1.
          output_size(int|list|tuple, optional): The output image size. If output size is a
              list/tuple, it must contain three integers, (image_depth, image_height, image_width).
              None if use filter_size(shape of weight), padding, and stride to calculate output_size.
          data_format (str, optional): Specify the data format of the input, and the data format of the output 
              will be consistent with that of the input. An optional string from: `"NCHW"`, `"NHWC"`.
              The default is `"NCHW"`. When it is `"NCHW"`, the data is stored in the order of:
              `[batch_size, input_channels, input_height, input_width]`.
          name(str, optional): For detailed information, please refer 
             to :ref:`api_guide_Name`. Usually name is no need to set and 
             None by default.
  
      Returns:
          A Tensor representing the conv3d_transpose, whose data
          type is the same with input and shape is (num_batches, channels, out_d, out_h, 
          out_w) or (num_batches, out_d, out_h, out_w, channels). If act is None, the tensor 
          variable storing the transposed convolution result, and if act is not None, the tensor 
          variable storing transposed convolution and non-linearity activation result.
  
      Raises:
          ValueError: If `data_format` is not "NCDHW" or "NDHWC".
          ValueError: If `padding` is a string, but not "SAME" or "VALID".
          ValueError: If `padding` is a list/tuple, but the element corresponding to the input's batch size is not 0 
              or the element corresponding to the input's channel is not 0.
          ValueError: If `output_size` and kernel_size are None at the same time.
          ShapeError: If the input is not 5-D Tensor.
          ShapeError: If the input's dimension size and filter's dimension size not equal.
          ShapeError: If the dimension size of input minus the size of `stride` is not 2.
          ShapeError: If the number of input channels is not equal to filter's channels.
          ShapeError: If the size of `output_size` is not equal to that of `stride`.
  
      Examples:
         .. code-block:: python
            
            import paddle
            import paddle.nn.functional as F
  
            x_var = paddle.randn((2, 3, 8, 8, 8), dtype='float32')
            w_var = paddle.randn((3, 6, 3, 3, 3), dtype='float32')
  
            y_var = F.conv3d_transpose(x_var, w_var)
            y_np = y_var.numpy()
  
            print(y_np.shape)
            # (2, 6, 10, 10, 10)
docstring_summary: r"""
      The convolution3d transpose layer calculates the output based on the input,
      filter, and dilations, strides, paddings. Input(Input) and output(Output)
      are in NCDHW or NDHWC 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.
      See more detail in :ref:`api_nn_conv_ConvTranspose3d` .
docstring_tokens: r The convolution3d transpose layer calculates the output based on the input filter and dilations strides paddings . Input ( Input ) and output ( Output ) are in NCDHW or NDHWC 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 . See more detail in : ref : api_nn_conv_ConvTranspose3d .
function: def conv3d_transpose(x,
                       weight,
                       bias=None,
                       stride=1,
                       padding=0,
                       output_padding=0,
                       groups=1,
                       dilation=1,
                       output_size=None,
                       data_format='NCDHW',
                       name=None):
      r"""
      The convolution3d transpose layer calculates the output based on the input,
      filter, and dilations, strides, paddings. Input(Input) and output(Output)
      are in NCDHW or NDHWC 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.
      See more detail in :ref:`api_nn_conv_ConvTranspose3d` .
  
      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 2-D Tensor with shape [M, 1].
      * :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}, D_{in}, H_{in}, W_{in})`
  
            Filter shape: :math:`(C_{in}, C_{out}, D_f, H_f, W_f)`
  
          - Output:
  
            Output shape: :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] * (D_f - 1) + 1 \\\\
             H^\prime_{out} &= (H_{in} - 1) * strides[1] - 2 * paddings[1] + dilations[1] * (H_f - 1) + 1 \\\\
             W^\prime_{out} &= (W_{in} - 1) * strides[2] - 2 * paddings[2] + dilations[2] * (W_f - 1) + 1 \\\\
             D_{out} &\in [ D^\prime_{out}, D^\prime_{out} + strides[0] ] \\\\
             H_{out} &\in [ H^\prime_{out}, H^\prime_{out} + strides[1] ] \\\\
             W_{out} &\in [ W^\prime_{out}, W^\prime_{out} + strides[2] ]
  
      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}, :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]`.
  
      Args:
          x(Tensor): The input is 5-D Tensor with shape [N, C, D, H, W] or [N, D, H, W, C], the data type 
              of input is float32 or float64.
          weight (Tensor): The convolution kernel, a Tensor with shape [C, M/g, kD, kH, kW],
              where M is the number of filters(output channels), g is the number of groups,
              kD, kH, kW are the filter's depth, height and width respectively.
          bias (Tensor, optional): The bias, a Tensor of shape [M, ].
          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: stride = 1.
          padding (string|int|list|tuple, optional): The padding size. It means the number of zero-paddings 
              on both sides for each dimension. If `padding` is a string, either 'VALID' or
              'SAME' which is the padding algorithm. If padding size is a tuple or list,
              it could be in three forms: `[pad_depth, pad_height, pad_width]` or
              `[pad_depth_front, pad_depth_back, pad_height_top, pad_height_bottom, pad_width_left, pad_width_right]`,
              and when `data_format` is `"NCDHW"`, `padding` can be in the form
              `[[0,0], [0,0], [pad_depth_front, pad_depth_back], [pad_height_top, pad_height_bottom], [pad_width_left, pad_width_right]]`.
              when `data_format` is `"NDHWC"`, `padding` can be in the form
              `[[0,0], [pad_depth_front, pad_depth_back], [pad_height_top, pad_height_bottom], [pad_width_left, pad_width_right], [0,0]]`.
              Default: padding = 0.
          output_padding(int|list|tuple, optional): Additional size added to one side
              of each dimension in the output shape. Default: 0.
          groups(int, optional): The groups number of the Conv3D 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
          dilation(int|list|tuple, optional): The dilation size. It means the spacing between the kernel points. 
              If dilation is a list/tuple, it must contain three integers, (dilation_depth, dilation_height, 
              dilation_width). Otherwise, dilation_depth = dilation_height = dilation_width = dilation. 
              Default: dilation = 1.
          output_size(int|list|tuple, optional): The output image size. If output size is a
              list/tuple, it must contain three integers, (image_depth, image_height, image_width).
              None if use filter_size(shape of weight), padding, and stride to calculate output_size.
          data_format (str, optional): Specify the data format of the input, and the data format of the output 
              will be consistent with that of the input. An optional string from: `"NCHW"`, `"NHWC"`.
              The default is `"NCHW"`. When it is `"NCHW"`, the data is stored in the order of:
              `[batch_size, input_channels, input_height, input_width]`.
          name(str, optional): For detailed information, please refer 
             to :ref:`api_guide_Name`. Usually name is no need to set and 
             None by default.
  
      Returns:
          A Tensor representing the conv3d_transpose, whose data
          type is the same with input and shape is (num_batches, channels, out_d, out_h, 
          out_w) or (num_batches, out_d, out_h, out_w, channels). If act is None, the tensor 
          variable storing the transposed convolution result, and if act is not None, the tensor 
          variable storing transposed convolution and non-linearity activation result.
  
      Raises:
          ValueError: If `data_format` is not "NCDHW" or "NDHWC".
          ValueError: If `padding` is a string, but not "SAME" or "VALID".
          ValueError: If `padding` is a list/tuple, but the element corresponding to the input's batch size is not 0 
              or the element corresponding to the input's channel is not 0.
          ValueError: If `output_size` and kernel_size are None at the same time.
          ShapeError: If the input is not 5-D Tensor.
          ShapeError: If the input's dimension size and filter's dimension size not equal.
          ShapeError: If the dimension size of input minus the size of `stride` is not 2.
          ShapeError: If the number of input channels is not equal to filter's channels.
          ShapeError: If the size of `output_size` is not equal to that of `stride`.
  
      Examples:
         .. code-block:: python
            
            import paddle
            import paddle.nn.functional as F
  
            x_var = paddle.randn((2, 3, 8, 8, 8), dtype='float32')
            w_var = paddle.randn((3, 6, 3, 3, 3), dtype='float32')
  
            y_var = F.conv3d_transpose(x_var, w_var)
            y_np = y_var.numpy()
  
            print(y_np.shape)
            # (2, 6, 10, 10, 10)
      """
      # entry checks
      if data_format not in ["NCDHW", "NDHWC"]:
          raise ValueError(
              "Attr(data_format) should be 'NCDHW' or 'NDHWC'. Received "
              "Attr(data_format): {}.".format(data_format))
  
      channel_last = (data_format == "NDHWC")
      channel_dim = -1 if channel_last else 1
      if len(x.shape) != 5:
          raise ValueError(
              "Input x should be 5D tensor, but received x with the shape of {}".
              format(x.shape))
      num_channels = x.shape[channel_dim]
      num_filters = weight.shape[1]
      if num_channels < 0:
          raise ValueError(
              "The channel dimension of the input({}) should be defined. "
              "Received: {}.".format(x.shape, num_channels))
      if groups <= 0:
          raise ValueError(
              "The groups of conv3d_transpose should be greater than 0. Received groups: {}".
              format(groups))
      if num_channels % groups != 0:
          raise ValueError(
              "The number of input channels must be divisible by Attr(groups). "
              "Received: number of channels({}), groups({}).".format(num_channels,
                                                                     groups))
  
      padding, padding_algorithm = _update_padding_nd(padding, channel_last, 3)
      stride = convert_to_list(stride, 3, 'stride')
      dilation = convert_to_list(dilation, 3, 'dilation')
      if output_size is None:
          output_size = []
      else:
          if output_padding != 0:
              raise ValueError('output_padding option is mutually exclusive with '
                               'output_size')
          if isinstance(output_size, (list, tuple, int)):
              output_size = convert_to_list(output_size, 3, 'output_size')
          else:
              raise ValueError(
                  "output_size should be int, or list, tuple of ints")
  
      if output_padding == 0:
          output_padding = []
      else:
          output_padding = convert_to_list(output_padding, 3, 'output_padding')
  
      cudnn_version = get_cudnn_version()
  
      #TODO(LielinJiang): whether to use cudnn according to the version of cudnn
      use_cudnn = True if (core.is_compiled_with_cuda() and
                           cudnn_version is not None) else False
  
      op_type = 'conv3d_transpose'
      data_format_ = "NHWC" if channel_last else "NCHW"
  
      if in_dygraph_mode():
          attrs = ('output_padding', output_padding, 'output_size', output_size,
                   'paddings', padding, "padding_algorithm", padding_algorithm,
                   'strides', stride, 'dilations', dilation, 'groups', groups,
                   'use_cudnn', use_cudnn, "data_format", data_format_)
          pre_bias = getattr(_C_ops, op_type)(x, weight, *attrs)
          if bias is not None:
              out = nn.elementwise_add(pre_bias, bias, axis=channel_dim)
          else:
              out = pre_bias
      else:
          inputs = {'Input': [x], 'Filter': [weight]}
          attrs = {
              'output_padding': output_padding,
              'output_size': output_size,
              'paddings': padding,
              "padding_algorithm": padding_algorithm,
              'strides': stride,
              'dilations': dilation,
              'groups': groups,
              'use_cudnn': use_cudnn,
              "data_format": data_format_
          }
          helper = LayerHelper(op_type, **locals())
          check_variable_and_dtype(x, 'x', ['float16', 'float32', 'float64'],
                                   'conv3d')
  
          pre_bias = helper.create_variable_for_type_inference(x.dtype)
          outputs = {"Output": [pre_bias]}
  
          helper.append_op(
              type=op_type, inputs=inputs, outputs=outputs, attrs=attrs)
          if bias is not None:
              out = nn.elementwise_add(pre_bias, bias, axis=channel_dim)
          else:
              out = pre_bias
  
      return out
function_tokens: def conv3d_transpose ( x , weight , bias = None , stride = 1 , padding = 0 , output_padding = 0 , groups = 1 , dilation = 1 , output_size = None , data_format = 'NCDHW' , name = None ) : # entry checks if data_format not in [ "NCDHW" , "NDHWC" ] : raise ValueError ( "Attr(data_format) should be 'NCDHW' or 'NDHWC'. Received " "Attr(data_format): {}." . format ( data_format ) ) channel_last = ( data_format == "NDHWC" ) channel_dim = - 1 if channel_last else 1 if len ( x . shape ) != 5 : raise ValueError ( "Input x should be 5D tensor, but received x with the shape of {}" . format ( x . shape ) ) num_channels = x . shape [ channel_dim ] num_filters = weight . shape [ 1 ] if num_channels < 0 : raise ValueError ( "The channel dimension of the input({}) should be defined. " "Received: {}." . format ( x . shape , num_channels ) ) if groups <= 0 : raise ValueError ( "The groups of conv3d_transpose should be greater than 0. Received groups: {}" . format ( groups ) ) if num_channels % groups != 0 : raise ValueError ( "The number of input channels must be divisible by Attr(groups). " "Received: number of channels({}), groups({})." . format ( num_channels , groups ) ) padding , padding_algorithm = _update_padding_nd ( padding , channel_last , 3 ) stride = convert_to_list ( stride , 3 , 'stride' ) dilation = convert_to_list ( dilation , 3 , 'dilation' ) if output_size is None : output_size = [ ] else : if output_padding != 0 : raise ValueError ( 'output_padding option is mutually exclusive with ' 'output_size' ) if isinstance ( output_size , ( list , tuple , int ) ) : output_size = convert_to_list ( output_size , 3 , 'output_size' ) else : raise ValueError ( "output_size should be int, or list, tuple of ints" ) if output_padding == 0 : output_padding = [ ] else : output_padding = convert_to_list ( output_padding , 3 , 'output_padding' ) cudnn_version = get_cudnn_version ( ) #TODO(LielinJiang): whether to use cudnn according to the version of cudnn use_cudnn = True if ( core . is_compiled_with_cuda ( ) and cudnn_version is not None ) else False op_type = 'conv3d_transpose' data_format_ = "NHWC" if channel_last else "NCHW" if in_dygraph_mode ( ) : attrs = ( 'output_padding' , output_padding , 'output_size' , output_size , 'paddings' , padding , "padding_algorithm" , padding_algorithm , 'strides' , stride , 'dilations' , dilation , 'groups' , groups , 'use_cudnn' , use_cudnn , "data_format" , data_format_ ) pre_bias = getattr ( _C_ops , op_type ) ( x , weight , * attrs ) if bias is not None : out = nn . elementwise_add ( pre_bias , bias , axis = channel_dim ) else : out = pre_bias else : inputs = { 'Input' : [ x ] , 'Filter' : [ weight ] } attrs = { 'output_padding' : output_padding , 'output_size' : output_size , 'paddings' : padding , "padding_algorithm" : padding_algorithm , 'strides' : stride , 'dilations' : dilation , 'groups' : groups , 'use_cudnn' : use_cudnn , "data_format" : data_format_ } helper = LayerHelper ( op_type , * * locals ( ) ) check_variable_and_dtype ( x , 'x' , [ 'float16' , 'float32' , 'float64' ] , 'conv3d' ) pre_bias = helper . create_variable_for_type_inference ( x . dtype ) outputs = { "Output" : [ pre_bias ] } helper . append_op ( type = op_type , inputs = inputs , outputs = outputs , attrs = attrs ) if bias is not None : out = nn . elementwise_add ( pre_bias , bias , axis = channel_dim ) else : out = pre_bias return out