MemSaveMaxPool2d

class memsave_torch.nn.MemSaveMaxPool2d(kernel_size, stride=1, padding=0, dilation=1, return_indices=False, ceil_mode=False)

MemSaveMaxPool2d.

Inits a Conv2d layer with the given params.

Parameters:
  • kernel_size – kernel_size

  • stride – stride

  • padding – padding

  • dilation – dilation

  • return_indices – return_indices

  • ceil_mode – ceil_mode

forward(input: Tensor) Tensor

Forward pass.

Parameters:

input – Input to the network [B, C_in, H, W]

Returns:

Output [B, C_out, H_out, W_out]

Return type:

torch.Tensor

classmethod from_nn_MaxPool2d(maxpool2d: MaxPool2d)

Converts a nn.MaxPool2d layer to MemSaveMaxPool2d.

Parameters:

maxpool2d – The nn.MaxPool2d layer

Returns:

The MemSaveMaxPool2d object

Return type:

obj

Hint

The usage is the same as torch.nn.MaxPool2d

For usage examples, please refer to the linked torch documentation