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.

PR

Just a small problem.

I can fix it online!

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.mint.nn.functional.conv_transpose2d

View Source On Gitee
mindspore.mint.nn.functional.conv_transpose2d(input, weight, bias=None, stride=1, padding=0, output_padding=0, groups=1, dilation=1)[source]

Applies a 2D transposed convolution operator over an input image composed of several input planes, sometimes also called deconvolution (although it is not an actual deconvolution).

Refer to mindspore.mint.nn.ConvTranspose2d for more details.

Warning

  • This is an experimental API that is subject to change or deletion.

  • In the scenario where inputs are non-contiguous, output_padding must be less than stride .

  • For Atlas training products, when the dtype of input is float32, the groups only supports 1.

Parameters
  • input (Tensor) – input tensor of shape (minibatch,in_channels,iH,iW) or (in_channels,iH,iW) .

  • weight (Tensor) – filters of shape (in_channels,out_channelsgroups,kH,kW) .

  • bias (Tensor, optional) – bias of shape (out_channels) . Default: None .

  • stride (Union[int, tuple(int), list[int]], optional) – the stride of the convolving kernel. Can be a single number or a tuple (sH,sW) . Default: 1 .

  • padding (Union[int, tuple(int), list[int]], optional) – dilation(kernel_size1)padding zero-padding will be added to both sides of each dimension in the input. Can be a single number or a tuple (padH,padW) . Default: 0 .

  • output_padding (Union[int, tuple(int), list[int]], optional) – additional size added to one side of each dimension in the output shape. Can be a single number or a tuple (out_padH,out_padW) . The value of output_padding must be less than stride or dilation . Default: 0 .

  • groups (int, optional) – split input into groups, in_channels should be divisible by the number of groups. Default: 1 .

  • dilation (Union[int, tuple(int), list[int]], optional) – the spacing between kernel elements. Can be a single number or a tuple (dH,dW) . Default: 1 .

Returns

Tensor of shape (minibatch,out_channels,oH,oW) or (out_channels,oH,oW) , where

oH=(iH1)×sH2×padH+dH×(kH1)+out_padH+1
oW=(iW1)×sW2×padW+dW×(kW1)+out_padW+1

Raises
  • TypeError – If stride, padding, output_padding or dilation is neither an int nor a tuple or a list.

  • TypeError – If groups is not an int.

  • ValueError – If the shape of bias is not (out_channels) .

  • ValueError – If stride or dilation is less than 1.

  • ValueError – If padding or output_padding is less than 0.

  • ValueError – If stride, padding, output_padding or dilation is a tuple whose length is not equal to 2.

Supported Platforms:

Ascend

Examples

>>> import mindspore
>>> import numpy as np
>>> from mindspore import Tensor, mint
>>> x = Tensor(np.ones([1, 4, 5, 5]), mindspore.float32)
>>> weight = Tensor(np.ones([4, 8, 3, 3]), mindspore.float32)
>>> output = mint.nn.functional.conv_transpose2d(x, weight)
>>> print(output.shape)
(1, 8, 7, 7)