How to properly implement an autograd.Function in Pytorch?

Based on the discussions here I found out that I should be using None for any inputs that I dont want the gradients for. so this is done.
I however would appreciate if anyone could tell me what that last snippet do though.
its greatly appreciated.