Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace jnp.where with static_select #369

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions diffrax/_step_size_controller/adaptive.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
VF,
Y,
)
from .._misc import upcast_or_raise
from .._misc import static_select, upcast_or_raise
from .._solution import RESULTS
from .._term import AbstractTerm, ODETerm
from .base import AbstractStepSizeController
Expand Down Expand Up @@ -604,7 +604,7 @@ def _scale(_y0, _y1_candidate, _y_error):
# This is important because we don't know whether or not the jump is as a
# result of a left- or right-discontinuity, so we have to skip the jump
# location altogether.
_t1 = jnp.where(made_jump, eqxi.nextafter(eqxi.nextafter(t1)), t1)
_t1 = static_select(made_jump, eqxi.nextafter(eqxi.nextafter(t1)), t1)
else:
_t1 = t1
next_t0 = jnp.where(keep_step, _t1, t0)
Expand Down
Loading