I can’t remember seeing a similar issue pointing to this line of code, so would need to reproduce it in order to debug it properly.
Are you trying to use the cudnn RNN in eval() mode during training? Also, are you using the latest PyTorch version?