Transform List to Tensor more accurat

Hello together,
I want to return in the Dataloader this list:

[[-0.0003000000142492354, -0.0008999999845400453, 0.00039999998989515007, 0], [0.0010000000474974513, -0.00019999999494757503, 0.0003000000142492354, 0], [0.00019999999494757503, -0.0005000000237487257, -0.0008999999845400453, 0], [5.484399795532227, -24.28619956970215, 117.5000991821289, 1]]

But to return it, its need to be a tensor right? So i transform it with:
pt_tensor_from_list = torch.tensor(pose_transform)
But information is lost in the process, is there another way to do this?
Output of pt_tensor_from_list:
([[ -0.0003, -0.0009, 0.0004, 0.0000],
[ 0.0010, -0.0002, 0.0003, 0.0000],
[ 0.0002, -0.0005, -0.0009, 0.0000],
[ 5.4844, -24.2862, 117.5001, 1.0000]])

I assume the first output was generated by numpy?
The information is most likely not lost, but the print options in numpy and PyTorch use different defaults for the precision.
Try setting torch.set_printoptions(10) (or even higher) and check the output again.

1 Like