Extend RNNBase class with c++ backend

Hi,

I have written in c++ the forward and backward functions for a custom recurrent neural network thanks to this tutorial : https://pytorch.org/tutorials/advanced/cpp_extension.html .

To benefit the pytorch API I would like to extend the RNNBase class from torch.nn.modules.rnn to make it behave exactly like a normal RNN. How would it be possible ?
As I understand it there is some kind of backend to register as Variable Function but I don’t understand how the binding is made.

Thanks for the help !