How to build my own convolutional method in Pytorch?

You could use unfold to create the patches, apply your custom operation using your filters, and fold or reshape the output back.
This post gives you an example of unfolding the input.