Hi,
Just a side note, you don’t need Variables anymore, you can just do p = torch.randn(800, 3, requires_grad=True).
The simplest thing you can do here, is just backprop on p and get the gradient as p.grad[0]. Will that work for you?