Solved by albanD in post #2 
              
              
                Hi, 
The functional methods in torch.nn are not all elementary functions for the autograd. So there isn’t a single backward function to call for them. 
What you can do though is get the gradient with the regular autograd: 
# inp that requires_grad=True and grad_output that match what you want to com…