torch.nn.functional.max_pool2d#
- torch.nn.functional.max_pool2d(input,kernel_size,stride=None,padding=0,dilation=1,ceil_mode=False,return_indices=False)[source]#
Applies a 2D max pooling over an input signal composed of several inputplanes.
Note
The order of
ceil_modeandreturn_indicesis different fromwhat seen inMaxPool2d, and will change in a future release.See
MaxPool2dfor details.- Parameters
input – input tensor, minibatch dim optional.
kernel_size – size of the pooling region. Can be a single number or atuple(kH, kW)
stride – stride of the pooling operation. Can be a single number or atuple(sH, sW). Default:
kernel_sizepadding – Implicit negative infinity padding to be added on both sides, must be >= 0 and <= kernel_size / 2.
dilation – The stride between elements within a sliding window, must be > 0.
ceil_mode – If
True, will useceil instead offloor to compute the output shape. Thisensures that every element in the input tensor is covered by a sliding window.return_indices – If
True, will return the argmax along with the max values.Useful fortorch.nn.functional.max_unpool2dlater