Skip to content

Commit

Permalink
Initialize V_inv on device
Browse files Browse the repository at this point in the history
  • Loading branch information
eigenvivek committed Dec 5, 2023
1 parent 97f4016 commit 3962fd9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# pytorchse3
pytorchse3
================

<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

Expand Down
2 changes: 1 addition & 1 deletion notebooks/01_se3.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
" B = taylor_B(theta)\n",
" D = (1 - A / (2 * B)) / theta.pow(2)\n",
" \n",
" V_inv = torch.eye(3) - 0.5 * log_R + D * log_R_2\n",
" V_inv = torch.eye(3, dtype=A.dtype, device=A.device) - 0.5 * log_R + D * log_R_2\n",
" log_t_vee = torch.einsum(\"bij, bj -> bi\", V_inv, t)\n",
"\n",
" return torch.concat([log_R_vee, log_t_vee], dim=-1)"
Expand Down
2 changes: 1 addition & 1 deletion pytorchse3/se3.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def se3_log_map(T: torch.Tensor):
B = taylor_B(theta)
D = (1 - A / (2 * B)) / theta.pow(2)

V_inv = torch.eye(3) - 0.5 * log_R + D * log_R_2
V_inv = torch.eye(3, dtype=A.dtype, device=A.device) - 0.5 * log_R + D * log_R_2
log_t_vee = torch.einsum("bij, bj -> bi", V_inv, t)

return torch.concat([log_R_vee, log_t_vee], dim=-1)
Expand Down

0 comments on commit 3962fd9

Please # to comment.