pub fn avgpool2d_backward<T: Triton, D: Num, const KH: i32, const KW: i32, const STRIDE_H: i32, const STRIDE_W: i32, const BLOCK_OW: i32>(
dy_ptr: T::Pointer<D>,
dx_ptr: T::Pointer<D>,
_B: i32,
C: i32,
H: i32,
W: i32,
OH: i32,
OW: i32,
)where
T::I32Tensor: Tensor<i32, 1> + Comparison<i32, BoolTensor = T::BoolTensor>,
T::Pointer<D>: AddOffsets<i32, 1, T::I32Tensor, Output = T::Tensor<T::Pointer<D>>>,Expand description
2-D average-pooling backward pass.
Uses the same flat 1-D grid as the forward pass, iterating over output
positions. For each output element dy[b, c, oh, ow], the gradient is
spread uniformly across the KH×KW input window via atomic_add so that
overlapping pooling windows (stride < kernel size) are handled correctly.
Constraints: dx must be zero-initialised before launch; same spatial
constraints as avgpool2d_forward.