Hello!

I had a question regarding retaining the gradients of tensors when converting to numpy arrays to do computations, for example in the code below, `kpts0`

and` kpts1`

are tensors which require gradients, unfortunately, the poselib library only accepts numpy arrays as inputs, so I detach the tenors, convert to numpy then convert the output to torch tensors with gradients set as true, but is it possible to convert to numpy arrays, pass to poselib and convert back to torch tensors while retaining the gradients?

Thank you!

```
def estimate_pose(kpts0, kpts1, K0, K1, thresh, conf=0.99999):
if len(kpts0) < 5:
return None
kpts0 = kpts0.detach().cpu().numpy()
kpts1 = kpts1.detach().cpu().numpy()
K0 = K0.detach().cpu().numpy()
K1 = K1.detach().cpu().numpy()
fx_0, fy_0, cx_0, cy_0 = K0[0, 0], K0[1, 1], K0[0, 2], K0[1, 2]
fx_1, fy_1, cx_1, cy_1 = K1[0, 0], K1[1, 1], K1[0, 2], K1[1, 2]
camera_0 = {"model": "PINHOLE", "width": int(2 * cx_0), "height": int(2 * cy_0), "params": [fx_0, fy_0, cx_0, cy_0]}
camera_1 = {"model": "PINHOLE", "width": int(2 * cx_1), "height": int(2 * cy_1), "params": [fx_1, fy_1, cx_1, cy_1]}
M, info = poselib.estimate_relative_pose(kpts0, kpts1, camera_0, camera_1, {"max_epipolar_error": thresh, "success_prob": conf})
R = M.R
t = M.t
R = torch.tensor(R, dtype=torch.float32, requires_grad=True).unsqueeze(0)
t = torch.tensor(t, dtype=torch.float32, requires_grad=True).unsqueeze(0)
P = torch.cat([R, t], dim=-1)
return P
```