conv1d从命名就可以看出就是一维卷积,其具体函数接口如下(该内容直接摘自官网):
import torch
import torch.nn as nn
m = nn.Conv1d(16,33,3,stride = 2)
input = torch.randn(20,16,50)
output = m(input)
print('output.shape = ',output.shape)
output.shape = torch.Size([20, 33, 24])
从上面理论和程序运行结果可理解如下图: