Hi @Luca_Pamparana,
I hope I don’t get you wrong, but can’t you just omit the return values of the hidden states in that line:



 Luca_Pamparana:

out, hidden, _ = model.forward(out, hidden)


And change it to
out, _, _ = model.forward(out, hidden)

Otherwise if you need the information of the hidden states at a different line in your code I would go for creating an extra variable. If you run into memory issues with that on gpu, you could pass this value to the cpu (maybe add an extra param within the models forward for memory allocation).