@deepcode are you talking about the NCC layer or implementing a custom layer in general?
I was able to write the code adn get it to work. If you want to write a custom layer, @vinayakvivek’s answer is very apt [override the forward() function].
If you are talking about the  implementation of NCC layer, well apart from the NCC, I also did some major changes in the layer to suite my architecture so I guess it won’t be of much use to you. But still if you want to have a look at the code, do let me know!