Assuming that PrRoIPool2D is a pooling layer with not parameter, your whole function is just linear.
And as such, its gradient is independent of the input.
This is why you get no grad_fn. Any grad1 that you would have computed will be filled with 0s.
You can make your network deeper so that it is not linear anymore to make the gradient depend on the input. And so it will have a grad_fn populated.
In general, if you get a gradient of None or not graph, it means that they are independent and so the value is just 0s.