Somewhere in your code you are defining a torch.autograd.Function in the deprecated format and you would have to use the new-style autograd function with the static methods. The link in the error message gives you an example.