Solved by albanD in post #2 
              
              
                Hi, 
When you do self.sigma_weight * self.epsilon_weight, then to compute the gradient of self.sigma_weight which is you Parameter, you need the value of self.epsilon_weight. 
So if you modify it inplace, after it was used in this computation, then you will see this error. 
The out of place version …