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

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

The output size is $L_{out}$, for any input size. The number of output features is equal to the number of input planes.

Parameters
• output_size – the target output size $L_{out}$.

• return_indices – if True, will return the indices along with the outputs. Useful to pass to nn.MaxUnpool1d. Default: False

Shape:
• Input: $(N, C, L_{in})$ or $(C, L_{in})$.

• Output: $(N, C, L_{out})$ or $(C, L_{out})$, where $L_{out}=\text{output\_size}$.

Examples

>>> # target output size of 5