Solved by ptrblck in post #2 
              
              
                I guess this error is raised during the forward pass, since the forward method definition is missing, so you would have to change call to forward.