@albanD Thanks for your suggestion! Yes, your understanding is correct. Actually I do need to compute the backward pass. So the volatile option may not be applicable here.
@apaszke Thanks for the info! Currently my module functions like a rnn. So only simple matrix multiplication, slicing, and nonlinearity function are used but they repeated by many times due to the iteration.