copapy.nn.avg_pool2d#
- copapy.nn.avg_pool2d(x, kernel_size, stride=None, padding=0)#
2D average pooling: the mean of each window, computed by a single array stencil.
- Parameters:
x (
TArr) – Input of shape (channels, height, width) or (batch, channels, height, width).kernel_size (
int|Sequence[int]) – Size of the window, a single integer or (vertical, horizontal).stride (
int|Sequence[int] |None) – Step of the window, a single integer or (vertical, horizontal). The default is the kernel size (windows without overlap).padding (
int|Sequence[int]) – Zero padding on both sides of the input, a single integer or (vertical, horizontal), at most half the kernel size. Padded elements count as zeros.
- Return type:
TArr- Returns:
Float array or tensor (same type as x) of shape (channels, out_height, out_width) with a leading batch dimension if x has one.