But the weight tensor then actually has the shape torch.Size([1, 6, 5]), while my kernel is just torch.Size([5]). Do you suggest to assign a repeated sequence of my kernel to the weights, such as
conv.weight = torch.nn.Parameter(kernel.repeat(6).view(1,6,5))
But also I expect an output of the same shape as the input, but in your example the output is of shape torch.Size([1, 1, 6]), which is different from the input shape torch.Size([1, 6, 6]). Above scipy function doesn’t change the shape.