model.modules.sum_pool.SumPool2d

model.modules.sum_pool.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

Define the computation performed at every call.

Attributes

training

forward(X: Tensor) Tensor[source]#

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.