Well, y should pointing to the inner variable. But every step I update the inner variables based on the deepcopies. Anyways, I found the problem. Thanks a lot!!!
The thing is I was using. eg:
y = x+3
instead of
x.copy_(x+3)
so none of the variables were beeing updated.