You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug Report] axis_angle_from_quat produces NaN gradients at identity rotations #9250
axis_angle_from_quat() returns the correct zero rotation vector for an identity quaternion, but its backward pass produces NaNs. The unselected exact-ratio branch of torch.where evaluates a zero denominator even when the Taylor approximation is selected.
Expected: [2., 2., 2., 0.]. Actual: NaN gradients.
System Info
main at ebf162a, macOS ARM64, PyTorch 2.12.0, CPU. Isaac Sim is not required.
Additional context
Protect the inactive exact-ratio branch from division by zero while preserving the existing Taylor approximation and forward values. The regression covers both quaternion signs of identity and fails before the fix. All 123 available math tests passed; three existing CUDA-only cases were skipped.
Thanks, @RandomOakForest, for confirming the gradient values. I reran the full math suite on the updated #9251 patch: 123 tests passed on CPU and the three CUDA-only cases were skipped. The identity regression is now kitless, the denominator fallback uses a scalar, and the final formatting correction is pushed.
Activity
RandomOakForest commentedon Dec 2, 2026
Thanks, I saw the NaN gradients at identity on main and #9251 gives
[2, 2, 2, 0].sylvesterkaczmarek commentedon Dec 2, 2026
Thanks, @RandomOakForest, for confirming the gradient values. I reran the full math suite on the updated #9251 patch: 123 tests passed on CPU and the three CUDA-only cases were skipped. The identity regression is now kitless, the denominator fallback uses a scalar, and the final formatting correction is pushed.