---
title: "MaxPool2d"
sidebar_label: "MaxPool2d"
description: "The clika_runtime.nn MaxPool2d class."
---

<!-- Generated by tools/api_reference/generate_api_docs.py. Do not edit. -->

MaxPool2d(kernel_size, stride=None, padding=(0, 0), dilation=(1, 1), ceil_mode=False)

    Max pooling over a 2-D window; the input is channels-last ``[N, D1..D2,
    C]``.

    The module form of ``clika_runtime.nn.functional.max_pool2d``: construct it
    once with the settings, then call it like a function.

    Args:
        kernel_size: the window extent per spatial dimension.
        stride: the window step per spatial dimension; empty takes
            ``kernel_size``; None takes the function's own default.
        padding: the implicit padding per spatial dimension; padded positions
            never win.
        dilation: the element spacing inside the window.
        ceil_mode: rounds the output extents up instead of down.
    

## `__init__`

```python
__init__(self, kernel_size: 'int | Sequence[int]', stride: 'int | Sequence[int] | None' = None, padding: 'int | Sequence[int]' = (0, 0), dilation: 'int | Sequence[int]' = (1, 1), ceil_mode: 'bool' = False) -> 'None'
```

Initialize self.  See help(type(self)) for accurate signature.

## `extra_repr`

```python
extra_repr(self) -> 'str'
```

extra_repr() -> str

One line of per-class detail for :meth:`__repr__`; a layer prints
its geometry here (``in_features=64, out_features=256``).

## `forward`

```python
forward(self, input: 'Tensor') -> 'Tensor'
```

forward(input) -> Tensor

Runs ``clika_runtime.nn.functional.max_pool2d`` on ``input`` with the
stored settings; returns a new tensor.
