Hi all,
I’m using Captum to do the integrated gradient for an LSTM model. If I just load the model and the weights, it shows cudnn RNN backward can only be called in training mode. I tried to remove model.eval() but it doesn’t give the correct result.
I also tried to put all the data and model to CPU and it works fine, but slowly. I’m not familiar with how PyTorch calculate the weights for LSTM but from the following thread, https://github.com/pytorch/captum/issues/564#issuecomment-748274352 10 , adding  torch.backends.cudnn.enabled=False fixed the problem.
I noticed the GPU is still in work with cudnn.enabled=False.
My question is what does backends.cudnn.enabled mean here and why LSTM requires it. When should we concern or use it? Thanks!