Solved by ptrblck in post #5 
              
              
                Could you post the code by wrapping it into three backticks ```, please? 
In your current cell it seems that def forward doesn’t have any indentation level and is thus a global method.