class torch.nn.MaxUnpool3d(kernel_size: Union[T, Tuple[T, T, T]], stride: Optional[Union[T, Tuple[T, T, T]]] = None, padding: Union[T, Tuple[T, T, T]] = 0)
[source]
Computes a partial inverse of MaxPool3d
.
MaxPool3d
is not fully invertible, since the non-maximal values are lost. MaxUnpool3d
takes in as input the output of MaxPool3d
including the indices of the maximal values and computes a partial inverse in which all non-maximal values are set to zero.
Note
MaxPool3d
can map several input sizes to the same output sizes. Hence, the inversion process can get ambiguous. To accommodate this, you can provide the needed output size as an additional argument output_size
in the forward call. See the Inputs section below.
input
: the input Tensor to invertindices
: the indices given out by MaxPool3d
output_size
(optional): the targeted output sizeOutput: , where
or as given by output_size
in the call operator
Example:
>>> # pool of square window of size=3, stride=2 >>> pool = nn.MaxPool3d(3, stride=2, return_indices=True) >>> unpool = nn.MaxUnpool3d(3, stride=2) >>> output, indices = pool(torch.randn(20, 16, 51, 33, 15)) >>> unpooled_output = unpool(output, indices) >>> unpooled_output.size() torch.Size([20, 16, 51, 33, 15])
© 2019 Torch Contributors
Licensed under the 3-clause BSD License.
https://pytorch.org/docs/1.7.0/generated/torch.nn.MaxUnpool3d.html