Skip to main content

AvgPool2d

AvgPool2d(kernel_size, stride=None, padding=(0, 0), ceil_mode=False, count_include_pad=True, divisor_override=None)

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

The module form of clika_runtime.nn.functional.avg_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 zero padding per spatial dimension. ceil_mode: rounds the output extents up instead of down. count_include_pad: counts padded positions in the divisor. divisor_override: a fixed divisor instead of the window count; None takes the function's own default.

__init__​

__init__(self, kernel_size: 'int | Sequence[int]', stride: 'int | Sequence[int] | None' = None, padding: 'int | Sequence[int]' = (0, 0), ceil_mode: 'bool' = False, count_include_pad: 'bool' = True, divisor_override: 'int | None' = None) -> 'None'

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

extra_repr​

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​

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

forward(input) -> Tensor

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