Skip to content

Commit

Permalink
Fix "auto" for forward-mode vs reverse-mode jacobians
Browse files Browse the repository at this point in the history
  • Loading branch information
brentyi committed Dec 23, 2024
1 parent 67239c1 commit 0991ee8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/jaxls/_factor_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def compute_jac_with_perturb(factor: _AnalyzedFactor) -> jax.Array:
"reverse": jax.jacrev,
"auto": jax.jacrev
if factor.residual_dim < val_subset._get_tangent_dim()
else jax.jacrev,
else jax.jacfwd,
}[factor.jac_mode]
return jacfunc(
# The residual function, with respect to to some local delta.
Expand Down

0 comments on commit 0991ee8

Please sign in to comment.