diff --git a/diffdrr/pose.py b/diffdrr/pose.py index 92c9dcb2..f3d97e65 100644 --- a/diffdrr/pose.py +++ b/diffdrr/pose.py @@ -106,13 +106,13 @@ def get_se3_log(self): # %% ../notebooks/api/06_pose.ipynb 7 def make_matrix(R, t): - assert (batch_size := len(R)) == len(t) + batch_size = len(R) + assert batch_size == len(t) matrix = torch.zeros(batch_size, 4, 4).to(R) matrix[..., :3, :3] = R matrix[..., :3, 3] = t matrix[..., -1, -1] = 1.0 return matrix - # %% ../notebooks/api/06_pose.ipynb 8 from scipy.spatial.transform import Rotation diff --git a/notebooks/api/06_pose.ipynb b/notebooks/api/06_pose.ipynb index 8555a35e..2aad6d4b 100644 --- a/notebooks/api/06_pose.ipynb +++ b/notebooks/api/06_pose.ipynb @@ -198,7 +198,8 @@ "source": [ "#| exporti\n", "def make_matrix(R, t):\n", - " assert (batch_size := len(R)) == len(t)\n", + " batch_size = len(R)\n", + " assert batch_size == len(t)\n", " matrix = torch.zeros(batch_size, 4, 4).to(R)\n", " matrix[..., :3, :3] = R\n", " matrix[..., :3, 3] = t\n",