A question about convolution with custom weights

I need to do a full convolution using designated weights with a special size, I should produce outputs that have same size with input but I can’t use padding because the value of weights are sensitive with their location. Does there be a way in pytorch to do this elegantly?
Any advice would be appreciated.

A code sample would be great to clarify what you want.