Spatially-varying filters for Conv2d

Is there an accepted way to implement spatially-varying filters for Conv2d? Or is that something that needs a custom implementation? If so, what would be the best way to go about doing that?

Just to be clear, by spatially-varying filters, I mean a convolutional layer where the filter changes as it slides across the feature map.

Thanks in advance for any suggestions.

Hi Alan !! Did you find the solution for the above question? If so, please let me know that