Skip to content

Commit

Permalink
Remove in-place operations, easier to port to numpy
Browse files Browse the repository at this point in the history
  • Loading branch information
brentyi committed Apr 26, 2023
1 parent 654d631 commit 8d0c242
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion jaxlie/_so2.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def as_matrix(self) -> jax.Array:
out = jnp.array(
[
# [cos, -sin],
cos_sin.at[1].multiply(-1),
cos_sin * jnp.array([1, -1]),
# [sin, cos],
cos_sin[::-1],
]
Expand Down
2 changes: 1 addition & 1 deletion jaxlie/_so3.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ def apply(self, target: hints.Array) -> jax.Array:
assert target.shape == (3,)

# Compute using quaternion multiplys.
padded_target = jnp.zeros(4).at[1:].set(target)
padded_target = jnp.concatenate([jnp.zeros(1), target])
return (self @ SO3(wxyz=padded_target) @ self.inverse()).wxyz[1:]

@override
Expand Down

0 comments on commit 8d0c242

Please sign in to comment.