Skip to content
masterclass Buddy

PyTorch · Class

nn.MaxPool2d

MaxPool2d applies 2D max pooling to each channel of an input. It keeps the largest value in each sliding window and can reduce height and width.

Last updated

Syntax

torch.nn.MaxPool2d(kernel_size, stride=None, padding=0, dilation=1, return_indices=False, ceil_mode=False)

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • torch.nn.MaxUnpool2d

Source: MaxPool2d — PyTorch main documentation. Checked 2026-11-03.