Table of Contents
Shortcuts

# AdaptiveMaxPool1d

class torch.nn.AdaptiveMaxPool1d(output_size, return_indices=False)

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

  The output size is L o u t L_{out}L o u t​, for any input size. The number of output features is equal to the number of input planes.

  Parameters:

    - output_size (Union[int, Tuple[int]]) – the target output size L o u t L_{out}L o u t​.

    - return_indices (bool) – if `True`, will return the indices along with the outputs. Useful to pass to nn.MaxUnpool1d. Default: `False`

  Shape:

    - Input: (N,C,L i n)(N, C, L_{in})(N,C,L in​) or (C,L i n)(C, L_{in})(C,L in​).

    - Output: (N,C,L o u t)(N, C, L_{out})(N,C,L o u t​) or (C,L o u t)(C, L_{out})(C,L o u t​), where L o u t=output_size L_{out}=\text{output\_size}L o u t​=output_size.

  Examples

      >>> # target output size of 5
      >>> m = nn.AdaptiveMaxPool1d(5)
      >>> input = torch.randn(1, 64, 8)
      >>> output = m(input)

## Docs

Access comprehensive developer documentation for PyTorch

View Docs

## Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

## Resources

Find development resources and get your questions answered

View Resources

To analyze traffic and optimize your experience, we serve cookies on this site. By clicking or navigating, you agree to allow our usage of cookies. As the current maintainers of this site, Facebook’s Cookies Policy applies. Learn more, including about available controls: Cookies Policy.