If you are writing a custom autograd.Function, then you would need the decorator.
However, base on your code it seems you might be able to just write an nn.Module and let Autograd figure out the backward pass. In this approach you wouldn’t need the @staticmethod decorator.