Rate this Page

torch.nn.functional.max_pool1d#

torch.nn.functional.max_pool1d(input,kernel_size,stride=None,padding=0,dilation=1,ceil_mode=False,return_indices=False)[source]#

Applies a 1D max pooling over an input signal composed of several inputplanes.

Note

The order ofceil_mode andreturn_indices is different fromwhat seen inMaxPool1d, and will change in a future release.

SeeMaxPool1d for details.

Parameters
  • input – input tensor of shape(minibatch,in_channels,iW)(\text{minibatch} , \text{in\_channels} , iW), minibatch dim optional.

  • kernel_size – the size of the window. Can be a single number or atuple(kW,)

  • stride – the stride of the window. Can be a single number or a tuple(sW,). Default:kernel_size

  • padding – Implicit negative infinity padding to be added on both sides, must be >= 0 and <= kernel_size / 2.

  • dilation – The stride between elements within a sliding window, must be > 0.

  • ceil_mode – IfTrue, will useceil instead offloor to compute the output shape. Thisensures that every element in the input tensor is covered by a sliding window.

  • return_indices – IfTrue, will return the argmax along with the max values.Useful fortorch.nn.functional.max_unpool1d later