Apparently some recent patch now requires returning Variables from torch.autograd.Function's backward method (before Tensor were fine). Try wrapping self.grads 29 with torch.autograd.Variable(self.grads).
I’m also affected with my own autograd functions.