thanks for your reply, if i not use @staticmethod decorator, then its showing runtime error:
Legacy autograd function with non-static forward method is deprecated. Please use new-style autograd function with static forward method. (Example: https://pytorch.org/docs/stable/autograd.html#torch.autograd.Function  26).
so that i followed your suggestion which you have given to jhonpool4 to include @staticmethor before the forward function, but i am getting another new issue : forward() missing 1 required positional argument, “x”.