max_pool2d

dragon.vm.torch.nn.functional.max_pool2d(
  input,
  kernel_size,
  stride=1,
  padding=0,
  ceil_mode=False,
  global_pooling=False
)[source]

Apply the 2d max pooling to input.

The spatial output dimension is computed as:

\[\text{Dim}_{out} = (\text{Dim}_{in} + 2 * pad - \text{K}_{size}) / stride + 1 \]
Parameters:
  • input (dragon.vm.torch.Tensor) – The input tensor.
  • kernel_size (Union[int, Sequence[int]]) – The size of sliding window.
  • stride (Union[int, Sequence[int]], optional, default=1) – The stride of sliding window.
  • padding (Union[int, Sequence[int]], optional, default=0) – The zero-padding size.
  • ceil_mode (bool, optional, default=False) – Ceil or floor the boundary.
  • global_pooling (bool, optional) – True to pool globally regardless of kernel_size.
Returns:

dragon.vm.torch.Tensor – The output tensor.