If this forward method is defined in an autograd.Function, you would not only need to decorate it with staticmethod, but also call the .apply function as described in the linked tutorial in my previous post.