Skip to content
fn

avg_pool2d_op

→TensorImplPtr
int avg_pool2d_op(const int & x, int KH, int KW, int stride_h, int stride_w, int pad_h, int pad_w, bool ceil_mode, bool count_include_pad)

Python wrappers

Public Python APIs implemented by this engine symbol.

Two-dimensional average pooling over a batch of feature maps.

Smooth, differentiable counterpart to max_pool2d_op. A common choice for global average pooling heads (use a kernel equal to the full spatial extent).

Parameters

xTensorImplPtr
Input of shape (B, C, H, W).
KH, KWint
Per-axis window size.
stride_h, stride_wint= None
Per-axis stride. 0 is a sentinel for non-overlapping windows. Default: 0.
pad_h, pad_wint= None
Per-axis zero-padding. Default: 0.

Returns

TensorImplPtr

Output of shape (B, C, H_out, W_out).