Skip to content

Commit

Permalink
Add eps argument
Browse files Browse the repository at this point in the history
  • Loading branch information
eigenvivek committed Mar 29, 2024
1 parent 66aebbf commit 4218a50
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions diffdrr/pose.py
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,7 @@ def axis_angle_to_quaternion(axis_angle: torch.Tensor) -> torch.Tensor:
"""
angles = torch.norm(axis_angle, p=2, dim=-1, keepdim=True)
half_angles = angles * 0.5
eps = 1e-6
small_angles = angles.abs() < eps
large = torch.sin(half_angles) / angles
small = 0.5 - (angles * angles) / 48
Expand Down
1 change: 1 addition & 0 deletions notebooks/api/06_pose.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,7 @@
" \"\"\"\n",
" angles = torch.norm(axis_angle, p=2, dim=-1, keepdim=True)\n",
" half_angles = angles * 0.5\n",
" eps = 1e-6\n",
" small_angles = angles.abs() < eps\n",
" large = torch.sin(half_angles) / angles\n",
" small = 0.5 - (angles * angles) / 48\n",
Expand Down

0 comments on commit 4218a50

Please sign in to comment.