Skip to content

🐍 Geometric Computer Vision Library for Spatial AI

remove inplace operation (#2346)

Johan Edstedt70e6c332d6f3
diff --git a/kornia/geometry/conversions.py b/kornia/geometry/conversions.py
index 85a13db65..a315fd2c2 100644
--- a/kornia/geometry/conversions.py
+++ b/kornia/geometry/conversions.py
@@ -337,10 +337,8 @@ def angle_axis_to_rotation_matrix(angle_axis: Tensor) -> Tensor:
mask_pos = (mask).type_as(theta2)
mask_neg = (~mask).type_as(theta2)
- # create output pose matrix
- rotation_matrix = eye_like(3, angle_axis, shared_memory=False)
- # fill output matrix with masked values
- rotation_matrix[..., :3, :3] = mask_pos * rotation_matrix_normal + mask_neg * rotation_matrix_taylor
+ # create output pose matrix with masked values
+ rotation_matrix = mask_pos * rotation_matrix_normal + mask_neg * rotation_matrix_taylor
return rotation_matrix # Nx3x3