MaxUnpool3d(kernel_size: Union[int, Tuple[int, int, int]], stride: Union[int, Tuple[int, int, int], None] = None, padding: Union[int, Tuple[int, int, int]] = 0)¶
Computes a partial inverse of
MaxPool3dis not fully invertible, since the non-maximal values are lost.
MaxUnpool3dtakes in as input the output of
MaxPool3dincluding the indices of the maximal values and computes a partial inverse in which all non-maximal values are set to zero.
MaxPool3dcan 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_sizein the forward call. See the Inputs section below.
input: the input Tensor to invert
indices: the indices given out by
output_size (optional): the targeted output size
Output: , where
or as given by
output_sizein the call operator
>>> # 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])