Solved by albanD in post #2 
              
              
                Hi, 
In the first case, only the input should be given, not the output. 
Are you running this in an interpreter? That would explain why the result of model(x) is printed in both your examples. 
For the backward hook, as you can see in the documentation, they are not working as expected at the moment…