Custom a new convolution layer in cnn

Dont know if this would be much help but you may probably be able to find it here

Read the documentation to build from source once you have made your changes.