Rate this Page

AdaptiveAvgPool1d#

classtorch.nn.modules.pooling.AdaptiveAvgPool1d(output_size)[source]#

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

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

Parameters:

output_size (int |tuple[int]) – the target output sizeLoutL_{out}.

Shape:

Examples

>>># target output size of 5>>>m=nn.AdaptiveAvgPool1d(5)>>>input=torch.randn(1,64,8)>>>output=m(input)
forward(input)[source]#

Runs the forward pass.

Return type:

Tensor