Why does pytorch prompt: RuntimeError: Legacy autograd function with non-static forward method is deprecated. Please use new-style autograd function with static forward method

Found a solution: Custom autograd.Function: must it be static? - #3 by Megh_Bhalerao