Hi,
I am a newbie have been working on simple RNN modelling, and now I am designing a system that has two models (model_A, model_B), both RNN models.
After trying weeks to solve my issue, and finally asking you guys for help to make it run.
My model is intended to work as follows:

model_A is trained with input x and output y …no problem.
when done, model_A is set to eval mode by 'model_A.eval() ’
model_B is defined and to be trained in the following way:
input x->model_B-> z(as nterim output)->model_A->y as output
then it shows an error when model_B.backward() is called : “cudnn RNN backward can only be called in training mode”
It seems like that model_A is blocking the gradient process. but have no idea how to work around it

I need your help for any ideas to solve this issue…
Thank you.