Location of GRU implementation

Hello,
I’m looking for the location of the GRU implementation so that I can make a modification to the gates.
I’m found some GRU implementation but it appears to be coded in C++ which I can’t use.

I’m wondering if there is a Python implementation for the GRU (like exists for the LSTM at /python3.10/site-packages/torch/nn/quantizable/rnn.py )

Thanks for the help! :slight_smile:

No, the easiest might be to take the LSTM and adapt it into a GRU.

Thanks for your reply, this is very do-able.
Do you happen to know the reason for the lack of a Python-implemented GRU?
It’s confusing given evidence of a GRU implementation is lying around in places.

image
image

My speculation would be that more or less everyone is using transformers now. :stuck_out_tongue:

If you base your work on the master branch and imitate the existing code well, you could see if there are any takers to add it.

1 Like

I think you are linking the quantizable rnn file, is that what you are looking for? if not, the floating point GRU implementation is here: pytorch/rnn.py at master · pytorch/pytorch · GitHub