Document feedback

Question document fragment

When a question document fragment contains a formula, it is displayed as a space.

Submission type
issue

It's a little complicated...

I'd like to ask someone.

Please select the submission type

Problem type
Specifications and Common Mistakes

- Specifications and Common Mistakes:

- Misspellings or punctuation mistakes,incorrect formulas, abnormal display.

- Incorrect links, empty cells, or wrong formats.

- Chinese characters in English context.

- Minor inconsistencies between the UI and descriptions.

- Low writing fluency that does not affect understanding.

- Incorrect version numbers, including software package names and version numbers on the UI.

Usability

- Usability:

- Incorrect or missing key steps.

- Missing main function descriptions, keyword explanation, necessary prerequisites, or precautions.

- Ambiguous descriptions, unclear reference, or contradictory context.

- Unclear logic, such as missing classifications, items, and steps.

Correctness

- Correctness:

- Technical principles, function descriptions, supported platforms, parameter types, or exceptions inconsistent with that of software implementation.

- Incorrect schematic or architecture diagrams.

- Incorrect commands or command parameters.

- Incorrect code.

- Commands inconsistent with the functions.

- Wrong screenshots.

- Sample code running error, or running results inconsistent with the expectation.

Risk Warnings

- Risk Warnings:

- Lack of risk warnings for operations that may damage the system or important data.

Content Compliance

- Content Compliance:

- Contents that may violate applicable laws and regulations or geo-cultural context-sensitive words and expressions.

- Copyright infringement.

Please select the type of question

Problem description

Describe the bug so that we can quickly locate the problem.

mindspore.ops.Conv3DTranspose

class mindspore.ops.Conv3DTranspose(in_channel, out_channel, kernel_size, mode=1, pad_mode='valid', pad=0, stride=1, dilation=1, group=1, output_padding=0, data_format='NCDHW')[source]

Computes a 3D transposed convolution, which is also known as a deconvolution (although it is not an actual deconvolution).

Input is typically of shape (N,C,D,H,W), where N is batch size, C is channel number, D is depth, H is height, W is width.

If the 'pad_mode' is set to be "pad", the depth, height and width of output are defined as:

Dout=(Din1)×stride[0]2×pad[0]+dilation[0]×(kernel_size[0]1)+output_padding[0]+1Hout=(Hin1)×stride[1]2×pad[1]+dilation[1]×(kernel_size[1]1)+output_padding[1]+1Wout=(Win1)×stride[2]2×pad[2]+dilation[2]×(kernel_size[2]1)+output_padding[2]+1

Note

In Ascend, only support group=1.

Parameters
  • in_channel (int) – The channel of the input x.

  • out_channel (int) – The channel of the weight x.

  • kernel_size (Union[int, tuple[int]]) – The data type is int or a tuple of 3 integers. Specifies the depth, height and width of the 3D convolution window. Single int means the value is for the depth, height and width of the kernel. A tuple of 3 ints means the first value is for the depth, the second value is for the height and the other is for the width of the kernel.

  • mode (int, optional) – Modes for different convolutions. Default is 1 . It is currently not used.

  • pad_mode (str, optional) –

    Specifies the padding mode with a padding value of 0. It can be set to: "same" , "valid" or "pad" . Default: "valid" .

    • "same": Pad the input around its depth/height/width dimension so that the shape of input and output are the same when stride is set to 1. The amount of padding to is calculated by the operator internally. If the amount is even, it isuniformly distributed around the input, if it is odd, the excess amount goes to the front/right/bottom side. If this mode is set, pad must be 0.

    • "valid": No padding is applied to the input, and the output returns the maximum possible depth, height and width. Extra pixels that could not complete a full stride will be discarded. If this mode is set, pad must be 0.

    • "pad": Pad the input with a specified amount. In this mode, the amount of padding in the depth, height and width dimension is determined by the pad parameter. If this mode is set, pad must be greater than or equal to 0.

  • pad (Union(int, tuple[int]), optional) – The pad value to be filled. Default: 0 . If pad is an integer, the paddings of head, tail, top, bottom, left and right are the same, equal to pad. If pad is a tuple of six integers, the padding of head, tail, top, bottom, left and right equal to pad[0], pad[1], pad[2], pad[3], pad[4] and pad[5] correspondingly.

  • stride (Union(int, tuple[int]), optional) – The distance of kernel moving, an int number that represents the depth, height and width of movement are both strides, or a tuple of three int numbers that represent depth, height and width of movement respectively. Default: 1 .

  • dilation (Union(int, tuple[int]), optional) – Specifies the space to use between kernel elements. Default: 1 .

  • group (int, optional) – The number of groups into which the filter is divided. in_channels and out_channels must be divisible by group. Default: 1 .

  • output_padding (Union(int, tuple[int]), optional) – Add extra size to each dimension of the output. Default: 0 .

  • data_format (str, optional) – The optional value for data format. Currently only 'NCDHW' is supported. Default: 'NCDHW'.

Inputs:
  • dout (Tensor) - The gradients with respect to the output of the convolution. The shape conforms to the default. data_format (N,Cin,Dout,Hout,Wout). Currently dout data type only supports float16 and float32.

  • weight (Tensor) - Set size of kernel is (Kd,Kh,Kw), then the shape is (Cin,Cout//group,Kd,Kh,Kw). Where group is the Args parameter, // is the symbol for integer division. Currently weight data type only supports float16 and float32.

  • bias (Tensor) - Tensor of shape Cout. Currently, only support none. Default: None .

Outputs:

Tensor, the gradients with respect to the input of convolution 3D. Tensor of shape (N,Cout//group,Dout,Hout,Wout), where group is the Args parameter.

Raises
  • TypeError – If in_channel, out_channel or group is not an int.

  • TypeError – If kernel_size, stride, pad , dilation or output_padding is neither an int not a tuple.

  • ValueError – If in_channel, out_channel, kernel_size, stride or dilation is less than 1.

  • ValueError – If pad is less than 0.

  • ValueError – If pad_mode is not one of 'same', 'valid' nor 'pad'.

  • ValueError – If pad is a tuple whose length is not equal to 6.

  • ValueError – If pad_mode is not equal to 'pad' and pad is not equal to (0, 0, 0, 0, 0, 0).

  • ValueError – If data_format is not 'NCDHW'.

  • TypeError – If data type of dout and weight is neither float16 nor float32.

  • ValueError – If bias is not none. The rank of dout and weight is not 5.

Supported Platforms:

Ascend GPU CPU

Examples

>>> import mindspore
>>> import numpy as np
>>> from mindspore import Tensor, ops
>>> dout = Tensor(np.ones([32, 16, 10, 32, 32]), mindspore.float16)
>>> weight = Tensor(np.ones([16, 3, 4, 6, 2]), mindspore.float16)
>>> conv3d_transpose = ops.Conv3DTranspose(in_channel=16, out_channel=3, kernel_size=(4, 6, 2))
>>> output = conv3d_transpose(dout, weight)
>>> print(output.shape)
(32, 3, 13, 37, 33)