Hi,
The problem is that because you copy something the requires grad into this, that Tensor starts requirering gradients, and so you start tracking all operations that happen to it.
In general, I would recommend to just have it being a temporary variable in the forward so that you don’t need to worry about that.
If for some reason, you want to keep it on self., you can detach it from the previous iterations by doing self.tensor_bidon = self.tensor_bidon.detach().