models.modules.SumPool2d

models.modules.SumPool2d#

class SumPool2d(kernel_size: int, stride: int = 1, padding: int = 0)[source]#

Bases: Module

Applies a 2D average pooling over an input signal composed of several input planes

Summarizes the values of the cells of a kernel. To do this, it calls torch.nn.functional.avg_pool2d() and multiplies the result by the kernel area.

Parameters:
  • kernel_size (int) – The size of the window.

  • stride (int, optional) – The stride of the window. Defaults to 1

  • padding (int, optional) – Implicit zero padding to be added on both sides. Defaults to 0

Methods

forward

Direct Module pass

Attributes

training

forward(X: Tensor) Tensor[source]#

Direct Module pass

Parameters:

X (torch.Tensor) – Input tensor.

Returns:

Result of summing pool.

Return type:

torch.Tensor