Solved by albanD in post #2 
              
              
                Hi, 
It is illegal because it would mean that the weight update would be done in a differentiable manner. 
So that means that in the next iteration, when computing the gradients, it will flow back through multiple iterations of your training loop which is most likely not what you want to do !