Solved by ptrblck in post #2 
              
              
                You could use the functional API with your custom weights: 
# Create gaussian kernels
kernel = Variable(torch.FloatTensor([[[0.006, 0.061, 0.242, 0.383, 0.242, 0.061, 0.006]]]))
# Create input
x = Variable(torch.randn(1, 1, 100))
# Apply smoothing
x_smooth = F.conv1d(x, kernel)