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]#
对由多个输入平面组成的输入信号应用 1D 最大池化。
注意
ceil_mode
和return_indices
的顺序与
中不同,并且在未来的版本中会发生改变。MaxPool1d
详情请参阅
。MaxPool1d
- 参数
input – 输入张量,形状为 ,minibatch 维度可选。
kernel_size – 窗口的大小。可以是一个数字,也可以是元组 (kW,)
stride – 窗口的步长。可以是一个数字,也可以是元组 (sW,)。默认为
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 – 如果为
True
,将使用 ceil 而不是 floor 来计算输出形状。这确保输入张量中的每个元素都被滑动窗口覆盖。return_indices – 如果为
True
,则会返回最大值的索引。这对于后续的
非常有用torch.nn.functional.max_unpool1d