Skip to content

Commit

Permalink
Fix: copy dtype and device in quat_action allocation
Browse files Browse the repository at this point in the history
  • Loading branch information
Romain BRÉGIER committed Nov 20, 2023
1 parent ef10b1e commit 40a0a9f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion roma/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ def quat_action(q, v, is_normalized=False):
"""
batch_shape = v.shape[:-1]
iquat = quat_conjugation(q) if is_normalized else quat_inverse(q)
pure = torch.cat((v, torch.zeros(batch_shape + (1,))), dim=-1)
pure = torch.cat((v, torch.zeros(batch_shape + (1,), dtype=q.dtype, device=q.device)), dim=-1)
res = quat_product(q, quat_product(pure, iquat))
return res[...,:3]

Expand Down

0 comments on commit 40a0a9f

Please sign in to comment.