Solved by albanD in post #2 
              
              
                Hi, 
The error mentions that you modify inplace a Tensor whole value is needed in the backward pass. 
In particular here, it seems that the content of context is needed. And so if you do context *= maybe_dropout (which modifies it inplace), then you can’t backward anymore. 
You need to make sure not…