Solved by phan_phan in post #6 
              
              
                So you work in mono-channel. 
In this case, try using B.permute(1, 2, 0) to obtain the desired shape: 
[batch_size, in_channels, sequence_length] (see docs). 
Then your kernel of size [5] needs to be [out_channel, in_channels, kernel_size], so it needs a kernel.view(1, 1, -1). 
And to keep the same …