Hi,
You don’t need Variables, anymore, you can simply do: torch.randn(4, 5, requires_grad=True) 
For your Function. Remember that the backward pass works in reverse from the forward. So the inputs to the backward match the outputs of the forward.
In your case, the backward should only have one input: gradient of the loss wrt result. And should return two things, the gradient wrt x and s.