MaxPool2d¶
- class
dragon.vm.torch.nn.
MaxPool2d
(
kernel_size,
stride=1,
padding=0,
ceil_mode=False
)[source]¶ Apply the 2d max pooling.
This module excepts the input size \((N, C, H, W)\), and output size is \((N, C, H_{\text{out}}, W_{\text{out}})\), where \(N\) is the batch size, \(C\) is the number of channels, \(H\) and \(W\) are the height and width of data.
Examples:
m = torch.nn.MaxPool2d(2, 2) x = torch.ones(2, 2, 2, 2) y = m(x)
See also
__init__¶
MaxPool2d.
__init__
(
kernel_size,
stride=1,
padding=0,
ceil_mode=False
)[source]¶Create a
MaxPool2d
module.- Parameters:
- kernel_size (Union[int, Sequence[int]]) – The size of pooling window.
- stride (Union[int, Sequence[int]], optional, default=1) – The stride of pooling window.
- padding (Union[int, Sequence[int]], optional, default=0) – The zero padding size.
- ceil_mode (bool, optional, default=False) – Ceil or floor the boundary.